Showing posts with label verb. Show all posts
Showing posts with label verb. Show all posts

Wednesday, March 21, 2012

UrlRewriting, CascadingDropDown and "*" verb

Hi,

I use urlrewriting. In IIS settings contains "*" verb.
When I use CascadingDropDown there is an error of "Method error 405".
When I delete "*" verb - all is OK.

How to decide a problem without the delete of "*"?

Your URL rewriter is probably interfering with ASP.NET AJAX's handler for web service traffic.

Hello,

thank you for reply.

For rapid solution with MS ASP.NET AJAX I use jointly Anthem.NET AJAX. DropDownList control in Anthem.NET AJAX is working without web service (data is loading directly from DataSet). These two libraries is working jointly without conflicts.


I had the same problem I have resolved it. It is a problem/bug with IIS 5, look here:http://forums.asp.net/t/1123124.aspx

You may also add form extender as described here:http://forums.asp.net/t/1129701.aspx.

This is the code you need:

Ok, I have fixed it. It requires this code. Seems like this is a bug in IIS 5...It is not stripping PathInfo correctly before handling request to ASP.NET

privatevoid OnBeginRequest(object sender,EventArgs e)

{

HttpApplication app = senderasHttpApplication;

HttpContext context = app.Context;

string path = context.Request.Path;

int aspx = path.IndexOf(".aspx/",StringComparison.OrdinalIgnoreCase);if (aspx >= 0)

{

context.RewritePath(

path.Substring(0, aspx + 5),

path.Substring(aspx + 5),

context.Request.QueryString.ToString());

return;

}

int asmx = path.IndexOf(".asmx/",StringComparison.OrdinalIgnoreCase);if (asmx >= 0)

context.RewritePath(

path.Substring(0, asmx + 5),

path.Substring(asmx + 5),

context.Request.QueryString.ToString());

}

}

use httpHandler of AJAX in web application

Hey all,

I want to implement AJAX in my current running web application.

I am going to use .

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>

in my web application.

I want to know ...

(1). will there be any side effect of the above code,

(2) will my current functionality got affected.

(3)what this code is all about and what it does.

1. No your should not see any side effects

2. The functionality should remain intact.

3. All this does is tell the webserver that when it gets a request for an .asmx page, to use the System.Web.Script.Services.ScriptHandlerFactory, and System.Web.Extensions classes to handle the request. for all verbs. So you .aspx, .ascx, etc will go unchanged and will continue to use the default HttpHandler. It then tells the web server to that when you recieve a GET or HEAD request for the ScriptResource.axd to use the System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions classes to handle te request. But since these classes extend the default classes that would normally handle the .asmx requests, then all your existing .asmx requests will work as originally intended. The above classes add the ability to JSON serialize requests for use with AJAX webservice calls.

Hope this helped clear things up.


thnx aquillin.

When I was not using the above code , I was getting error like "sys is undefined".
Yesterday I was reading an article and it said that the code generates the required javascript as AJAX uses it.

you said "All this does is tell the webserver that when it gets a request for an.asmx page, to use the System.Web.Script.Services.ScriptHandlerFactory...........,"

I have one dought that what is the link of .asmx (asp.net web services here). I am not using any web service .

Am i using them as hidden ?


The code actually doestwo things. One is the handling of .asmx web services. The other is handling of calls to ScriptResource.axd. That's required to deliver the Microsoft AJAX Library to the client.

It shouldn't affect your application unless for some reason you were already using something called ScriptResource.axd (extremely unlikely, but just being complete).