views:

322

answers:

4

I'm trying to use jQuery to make some AJAX calls, but because I have wild card mapping (to .NET) in IIS 6 turned on, it doesn't seem to work. Disabling the mapping makes everything magically work.

I've put the web method attribute on methods in both an .aspx page and an .asmx web service, but neither work. Here is the sample URL that I am using for the AJAX calls:

localhost/UserChecker.aspx/CheckIfUserEmailsExists

localhost/UserChecker.asmx/CheckIfUserEmailsExists

I figure it must be something with the way .NET is interpreting the URL's but I'm not entirely sure why. More importantly, I'm not sure how to fix it, other than to disable wild card mapping! Is there any other way???

UPDATE

The CMS I am using (Kentico) does some URL routing, but even if I skip over the routing in the global.asax.cs code, I still get a 404.
Thanks in advance!

+1  A: 

This is not a complete answer but I hope it points you in the direction of a solution.

Have you tried accessing the url directly in a browser and using some well placed breakpoints to track down the problem?

If you're getting 404s it sounds like your rules for routing aren't working.

[I'll update this if you can give a little more info about the behaviour you're seeing]

UPDATE

I think what might be happening is this:

You're providing a seperate mapping for your files with extensions (in these cases .aspx and .asmx):

localhost/UserChecker.aspx/CheckIfUserEmailsExists

localhost/UserChecker.asmx/CheckIfUserEmailsExists

These mappings are being used when you turn the wild card mappings off, and the '/CheckIfUserEmailsExists' is handled used or ignored. When you turn on the wildcard mappings your routing isn't informing your app how to 'route' correctly.

If you removed the extensions (with wildcard mappings turned on) does the following work?

localhost/UserChecker/CheckIfUserEmailsExists

Lewis
I have tried debugging it, but I'm not entirely sure what I'm looking for. I put a breakpoint in the global.asax.cs `Application_BeginRequest` event handler, and skipped over Kentico's routing code, but it still gives me a 404. If I access the the service or page by itself, it works fine. But when I add the ".NET Invoke" syntax, and append a "/" and the method name it doesn't work. If I disable wild card mapping, everything works fine.
SkippyFire
Removing the extension doesn't work, and I'm not sure how that would help anyway? How would IIS and .NET have any way of knowing how to manage the request?
SkippyFire
I don't know Kentico and you said you were doing some kind of routing, the fact that you are trying to use wildcards implies that you are trying to send all your requests via the asp dll anyway - unless I've misunderstood the question!
Lewis
I mean, how would they know how to interpret the requests and serve the correct page or data?
SkippyFire
Unfortunately I dont know Kentico but I was assuming that they had some form of HttpModule or handler that was doing this which would provide this functionality: http://devnet.kentico.com/docs/devguide/index.html?wildcard_urls.htm
Lewis
Looks like your answer is there in the Docs:http://devnet.kentico.com/docs/devguide/index.html?wildcard_urls.htm
Lewis
+1  A: 

With the wildcard mapping on IIS will run the initial request via the wildcard handler first. This will be done BEFORE any URL rewriting (or URL routing) by your CMS.

I think that is why you are getting 404.

You can also try to disable "verify file exists" checkbox on the wildcard mapping to cater for the scenario when the actual URL will be later rewritten to something else.

DmitryK
A: 

Add the appropriate URLs to the exclusion list: Use the "Excluded URLs" setting in the Site Manager->Settings tab. (basic help documentation)

Mufasa
A: 

I suggest checking the URl outside of your CMS framework; Issue has to be with the URL routing. No tsure how it was working without the wild card mapping.

Questions to understand: 1.Did you have your CMS running when trying without wild card mapping? 2. How does this CMS system interact with IIS; IASPI dll ? or HTTP Handlers/modules?

Krishna Kumar