Wildcard Extensions, RewritePath and /jsdebughttp://forums.asp.net/t/1113541.aspx/1?Wildcard+Extensions+RewritePath+and+jsdebugTue, 22 Apr 2008 17:01:21 -040011135411719741http://forums.asp.net/p/1113541/1719741.aspx/1?Wildcard+Extensions+RewritePath+and+jsdebugWildcard Extensions, RewritePath and /jsdebug <p>What we have here is not an unusual situation, but not a common one. </p> <p>We are using a wildcard extension mapping &quot;.*&quot; mapped to the asp.net (2.0) isapi library. We're doing this so that we can do UrlRewriting without using a seperate ISAPI extension and so that we can handle url rewrites on directories and configure the rewrites using the website's local web.config.&nbsp;&nbsp;</p> <p><img src="http://i7.tinypic.com/4vrlhf9.jpg"></p> <p>We have sections for exceptions on file extensions and directories, and overall this works really well... until we have to implement asp.net ajax.</p> <p>Because asp.net ajax's ScriptManager defines the script in html as src=&quot;ws/WebService.asmx/jsdebug&quot; IIS sends this request to ASP.NET, which then looks for that directory path, and naturally, it doesnt exist. </p> <p>So it throws a nasty ASP.NET 404 error when attempting to view <a href="http://siteurl/ws/WebService/jsdebug"> http://siteurl/ws/WebService/jsdebug</a>. </p> <p>I'm going to go out on a limb here and assume that whatever mechanism the asp.net ajax library is using to generate this javascript is being interrupted by all requests coming to the aspnet_isapi library. When I disable the wildcard extension mapping, everything works as it should.</p> <p>ASP.NET AJAX Developers! How can I work around this limitation, using our current setup?</p> 2007-05-22T15:59:52-04:001731107http://forums.asp.net/p/1113541/1731107.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Hi,</p> <p>I fail to reproduce the issue. Can you show me your code?&nbsp;</p> 2007-05-30T03:15:47-04:001731770http://forums.asp.net/p/1113541/1731770.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>I am also using wildcard extension and UrlRewriting and I have no problem with that.</p> <p>&nbsp;</p> <p>Maybe this is due to the fact that I added this line to my web.config (in order to solve another problem):</p> <p>&nbsp; <br> </p> <pre class="prettyprint">&lt;add verb=&quot;*&quot; path=&quot;*.js&quot; type=&quot;System.Web.StaticFileHandler&quot;/&gt;</pre> <p>&nbsp;&nbsp;</p> <p>this must be placed in the &quot;system.web&quot; then &quot;httpHandlers&quot; section.<br> </p> 2007-05-30T12:41:13-04:001743274http://forums.asp.net/p/1113541/1743274.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>I'm experiencing the same exact problem. In fact, this problem even occurs when UrlRewriting.Net is disabled. I'm currently running ASP.NET 2.0 on Windows 2000 with IIS 5.0.</p> <p>When I define the wildcard extension mapping, ScriptService URLs (e.g. xxxxx.asmx/js, xxxxx.asmx/jsdebug, and xxxxx.asmx/MethodName) all fail to work.</p> <p>However, when I remove the wildcard mapping, everything works again.<br> </p> <p>One interesting I noticed is the way how IIS handle urls like &quot;xxxxx.asmx/js&quot; under the &quot;no wildcard extension mapping&quot; default IIS configuration.</p> <p>For a URL like &quot;xxxxx.asmx/js&quot;, I had expected it to fail under the default configuration since it should technically treat the URL as an extension-less url. Instead, it seems like IIS progressively traverse the path nodes and check to see if a node in the path resolves to an actual file. And if it does, it changes the requested path from &quot;/xxxxx.asmx/js&quot; to &quot;/xxxxx.asmx&quot; and stuffs the &quot;/js&quot; part as the &quot;PathInfo&quot; request header. (http://msdn2.microsoft.com/en-us/library/system.web.httprequest.pathinfo.aspx)<br> </p> <p>&nbsp;It seems like when wildcard extension mapping is turned on, IIS disables that behavior and forwards the request to ASP.net without parsing the requested path.</p> <p>&nbsp; Does this make sense?<br> &nbsp;</p> <p>-David<br> </p> 2007-06-07T08:03:37-04:001745259http://forums.asp.net/p/1113541/1745259.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>I figured out why.</p> <p>This misbehavior can be reproduced on IIS 5.0 (Windows 2000) and IIS 5.1 (Windows XP Pro). It does not effect VS's development server nor IIS 6.0.</p> <p>When IIS 5.x sees a URL like this &quot;/webservices/helloworld.asmx/js&quot;, it splits them into token and iterates through them from left to right. For each token, it checks to see if it ends as a string that matches an extension mapping. As soon as it finds it, it stops. At this point, before IIS forward the request to ASP.Net's ISAPI extension, it takes that finding and creates two server variables: URL and PATH_INFO.</p> <p>For example, the following URL:</p> <p>&nbsp;&nbsp;&nbsp; &quot;/webservices/helloworld.asmx/js&quot;</p> <p>would cause IIS to define the following server variables:&nbsp;</p> <p>&nbsp;&nbsp;&nbsp; SERVER_VARIABLE[&quot;URL&quot;]: &quot;/webservices/helloworld.asmx&quot;<br> &nbsp;&nbsp;&nbsp; SERVER_VARIABLE[&quot;PATH_INFO&quot;]: &quot;/webservices/helloworld.asmx/js&quot;<br> <br> Similarly, a URL like this:</p> <p>&nbsp;&nbsp;&nbsp; &quot;/nonexistent.aspx/helloworld.asmx/js&quot;</p> <p>would cause IIS to define the following server variables:</p> <p>&nbsp;&nbsp;&nbsp; SERVER_VARIABLE[&quot;URL&quot;]: &quot;/nonexistent.aspx&quot;<br> &nbsp;&nbsp;&nbsp; SERVER_VARIABLE[&quot;PATH_INFO&quot;]: &quot;/nonexistent.aspx/helloworld.asmx/js&quot;</p> <p>When you turn on IIS 5.x wildcard extension mapping, this logic never gets executed. Instead, IIS defines the URL server variable the same way it defines PATH_INFO (i.e. nothing is stripped out).</p> <p>ASP.Net does not like this. Without URL rewriting, ASP.Net doesn't know how to handle the request &quot;/webservices/helloworld.asmx/js&quot;. Because of this, ASP.Net forwards the request to the FileNotFound http handler which displays the 404 error page we see.</p> <p>Again, this only applies to IIS 5.x and not IIS 6.0. IIS 6.0 seems to have reworked this logic in the expected way.</p> <p>&nbsp;To solve this problem, create a file called IIS5XWildCardExtensionFix.cs and place it in your App_Code folder:</p> <pre class="prettyprint">using System; using System.Web; public class IIS5XWildCardExtensionFix : IHttpModule { public IIS5XWildCardExtensionFix() { } public void Dispose() { } public void Init(HttpApplication context) { context.BeginRequest &#43;= new EventHandler(OnBeginRequest); } private void OnBeginRequest(object sender, EventArgs e) { HttpApplication app = sender as HttpApplication; HttpContext context = app.Context; string path = context.Request.Path; int asmx = path.IndexOf(&quot;.asmx/&quot;, StringComparison.OrdinalIgnoreCase); if (asmx &gt;= 0) context.RewritePath( path.Substring(0, asmx &#43; 5), path.Substring(asmx &#43; 5), context.Request.QueryString.ToString()); } }</pre><p>&nbsp;<br>Add the following line to in your web.config file in the HttpModules tag:</p><pre class="prettyprint">&lt;<span class="tag">add</span><span class="attr"> name=</span><span class="attrv">"IIS5XWildCardExtensionFix"</span><span class="attr"> type=</span><span class="attrv">"IIS5XWildCardExtensionFix"</span> /&gt; </pre> <p>This code inserts the missing logic using ASP.Net's HTTP Module framework.</p> <p>This code is derived from djMax's <a href="/p/1056692/1507487.aspx#1507487">post</a>.<br> </p> <p>-David&nbsp;</p> 2007-06-08T08:10:48-04:001746506http://forums.asp.net/p/1113541/1746506.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Fantastic work. I really appreciate you diving into this logic and figuring out the problem. We are, in fact, running XP Pro on most of our development machines. </p> <p>I'll be giving this fix a shot next week Monday and will report back with my findings.</p> 2007-06-08T22:25:35-04:001746574http://forums.asp.net/p/1113541/1746574.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>I tried this solution without luck :\ Will create a new thread with the info.</p> <p>Basically, removing the wildcard extension mapping fixes the issue, but we need to&nbsp;retain that mapping, so since adding it we are getting the 'Sys is undefined' error indicating the client is not receiving the .js file.</p> 2007-06-09T00:16:13-04:001746578http://forums.asp.net/p/1113541/1746578.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>&nbsp;You don't have to remove the wildcard extension mapping. In fact, this code is meant to address the issue introduced by defining the wildcard extension mapping.<br> &nbsp;</p> 2007-06-09T00:20:20-04:001746582http://forums.asp.net/p/1113541/1746582.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Here is the .vb&nbsp;we used, and included the tag in our web.config</p> <font color="#0000ff" size="2"> <p>Imports</font><font size="2"> System<br> </font><font color="#0000ff" size="2">Imports</font><font size="2"> System.Web<br> </font><font color="#0000ff" size="2">Imports</font><font size="2"> Microsoft.VisualBasic</p> </font><font color="#0000ff" size="2">Public</font><font size="2"> </font><font color="#0000ff" size="2">Class</font><font size="2"> IIS5XWildCardExtensionFix<br> </font><font color="#0000ff" size="2">Implements</font><font size="2"> IHttpModule</font><font size="2"> <p></font><font color="#0000ff" size="2">Public</font><font size="2"> </font><font color="#0000ff" size="2">Sub</font><font size="2"> </font><font color="#0000ff" size="2">New</font><font size="2">()<br> </font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Sub</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">Public</font><font size="2"> </font><font color="#0000ff" size="2">Sub</font><font size="2"> Dispose() </font><font color="#0000ff" size="2">Implements</font><font size="2"> System.Web.IHttpModule.Dispose<br> </font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Sub</p> </font><font size="2"> <p></font><font color="#0000ff" size="2">Public</font><font size="2"> </font><font color="#0000ff" size="2">Sub</font><font size="2"> Init(</font><font color="#0000ff" size="2">ByVal</font><font size="2"> context </font><font color="#0000ff" size="2">As</font><font size="2"> System.Web.HttpApplication) </font><font color="#0000ff" size="2">Implements</font><font size="2"> System.Web.IHttpModule.Init<br> </font><font color="#0000ff" size="2">AddHandler</font><font size="2"> context.BeginRequest, </font><font color="#0000ff" size="2">AddressOf</font><font size="2"> OnBeginRequest<br> </font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Sub</p> </font><font size="2"></font><font color="#0000ff" size="2">Private</font><font size="2"> </font><font color="#0000ff" size="2">Sub</font><font size="2"> OnBeginRequest(</font><font color="#0000ff" size="2">ByVal</font><font size="2"> sender </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">Object</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> e </font><font color="#0000ff" size="2">As</font><font size="2"> EventArgs)<br> </font><font color="#0000ff" size="2">Dim</font><font size="2"> app </font><font color="#0000ff" size="2">As</font><font size="2"> HttpApplication = </font><font color="#0000ff" size="2">CType</font><font size="2">(sender, HttpApplication)<br> </font><font color="#0000ff" size="2">Dim</font><font size="2"> context </font><font color="#0000ff" size="2">As</font><font size="2"> HttpContext = app.Context<br> </font><font color="#0000ff" size="2">Dim</font><font size="2"> path </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = context.Request.Path<br> </font><font color="#0000ff" size="2">Dim</font><font size="2"> asmx </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">Integer</font><font size="2"> = path.IndexOf(</font><font color="#800000" size="2">&quot;.asmx/&quot;</font><font size="2">, StringComparison.OrdinalIgnoreCase)<br> </font><font color="#0000ff" size="2">If</font><font size="2"> (asmx &gt;= 0) </font> <font color="#0000ff" size="2">Then<br> </font><font size="2">context.RewritePath(path.Substring(0, asmx &#43; 5), path.Substring(asmx &#43; 5), context.Request.QueryString.ToString())<br> </font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">If<br> </font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Sub</font><font color="#0000ff" size="2"> <p>End</font><font size="2"> </font><font color="#0000ff" size="2">Class</p> </font> 2007-06-09T00:23:36-04:001746586http://forums.asp.net/p/1113541/1746586.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>understood, thank you. We aren't able to remove the wildcard mapping which is why I am attempting this workaround. So far no luck, but thank you for your help thus far.</p> 2007-06-09T00:28:26-04:001746593http://forums.asp.net/p/1113541/1746593.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Are you guys stripping out &quot;.asmx&quot; during the URL rewriting process?</p> <p>This will not work: <a href="http://siteurl/ws/WebService/jsdebug">http://yoursite.com/ws/WebService/jsdebug</a><br> This will work: <a href="http://siteurl/ws/WebService/jsdebug">http://yoursite.com/ws/WebService.asmx/jsdebug</a><br> </p> <p>What's the src attribute in your aspx page's script tag?<br> </p> 2007-06-09T00:42:51-04:001747188http://forums.asp.net/p/1113541/1747188.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>we are not actually rewriting urls, we are securing documents in particular directories using forms authentication. In order for this to work for documents other than aspx files, we needed to add the wildcard application mapping. I tried specifically&nbsp;granting access&nbsp;the ScriptResource.axd and WebResource.axd files in the web.config per other posts suggestions but nothing has yet worked. I can provide url if it's allowed, or email it...</p> 2007-06-09T22:31:33-04:001787690http://forums.asp.net/p/1113541/1787690.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p></p> <blockquote><span class="icon-blockquote"></span> <h4>buddydvd2</h4> <p>I'm experiencing the same exact problem. In fact, this problem even occurs when UrlRewriting.Net is disabled. I'm currently running ASP.NET 2.0 on Windows 2000 with IIS 5.0.</p> <p>When I define the wildcard extension mapping, ScriptService URLs (e.g. xxxxx.asmx/js, xxxxx.asmx/jsdebug, and xxxxx.asmx/MethodName) all fail to work.</p> <p>However, when I remove the wildcard mapping, everything works again.<br> </p> <p>One interesting I noticed is the way how IIS handle urls like &quot;xxxxx.asmx/js&quot; under the &quot;no wildcard extension mapping&quot; default IIS configuration.</p> <p>For a URL like &quot;xxxxx.asmx/js&quot;, I had expected it to fail under the default configuration since it should technically treat the URL as an extension-less url. Instead, it seems like IIS progressively traverse the path nodes and check to see if a node in the path resolves to an actual file. And if it does, it changes the requested path from &quot;/xxxxx.asmx/js&quot; to &quot;/xxxxx.asmx&quot; and stuffs the &quot;/js&quot; part as the &quot;PathInfo&quot; request header. (http://msdn2.microsoft.com/en-us/library/system.web.httprequest.pathinfo.aspx)<br> </p> <p>&nbsp;It seems like when wildcard extension mapping is turned on, IIS disables that behavior and forwards the request to ASP.net without parsing the requested path.</p> </blockquote> <p>Buddydvd2. I think I have very similar problem you are experiencing, but littel different. Enabling IIS Wildcard makes Ajax Toolkit Slides control not working. I have posted the problem here, please take a look: <a href="http://forums.asp.net/t/1129701.aspx">http://forums.asp.net/t/1129701.aspx</a></p> <p>I have tried to apply your logic to axd files, but that did not help&nbsp;</p> <p>Please help anybody</p> 2007-07-05T03:41:20-04:001787706http://forums.asp.net/p/1113541/1787706.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p></p> <blockquote><span class="icon-blockquote"></span> <h4>buddydvd2</h4> <p>Are you guys stripping out &quot;.asmx&quot; during the URL rewriting process?</p> <p>This will not work: <a href="http://siteurl/ws/WebService/jsdebug">http://yoursite.com/ws/WebService/jsdebug</a><br> This will work: <a href="http://siteurl/ws/WebService/jsdebug">http://yoursite.com/ws/WebService.asmx/jsdebug</a><br> </p> <p>What's the src attribute in your aspx page's script tag?<br> </p> <p></p> </blockquote> <p></p> <p>This is the source I have on my page for Slides Control in Ajax Toolkit:</p> <p>&lt;script src=&quot;/Ajax/WebResource.axd?d=BP8NIIT9ZyjyxNDvn4jUWQ2&amp;amp;t=633144946505000000&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p><br> &lt;script src=&quot;/Ajax/ScriptResource.axd?d=OjqU9cYdOHT3Lc3mu9VgciBgwPmofPtVg5ti2UT6BGvFCwWflQSi8HHOJb5SHbTBOpqi8xLjNGpMCKeePlMrcNXw15AoxwpCVLq3SBhMer81&amp;amp;t=633144934480000000&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>Please help</p> 2007-07-05T03:49:14-04:001787717http://forums.asp.net/p/1113541/1787717.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Hi Rafal,</p> <p>Try your solution on a machine with IIS 6 installed. The error you're getting is most likely caused by IIS 5.x. The error response you got, &quot;<strong>HTTP verb POST not allowed</strong>&quot;, says that the request didn't even get routed to ASP.Net's ISAPI extension module yet.<br> </p> <p>Also, make sure you select &quot;All verbs&quot; in the extension mapping dialog for your wildcard mapping (i.e &quot;*.&quot;).</p> <p>Hope that helps,<br> Good luck.</p> <p>-David<br> &nbsp;</p> 2007-07-05T04:00:50-04:001787740http://forums.asp.net/p/1113541/1787740.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>David,</p> <p>You are absolutly right!!! I just notice I have IIS 5 installed.&nbsp; It works fine if I have wildcard &quot;.*&quot; disabled, but if I have it enabled I am getting</p> <p>Java Script error:</p> <p><strong>HTTP verb POST used to access path '/mysite/SlideShow/Slideshow.aspx/getSlides is not allowed</strong> </p> <p>I have tried your solution, but it does not work. I wonder if thsi has something to do with .axd files instead...&nbsp;</p> <p>I do not have access to IIS 6 now... I will try to upgrade... I am not sure if IIS 6 is available on XP...</p> <p>&nbsp;</p> 2007-07-05T04:14:20-04:001787830http://forums.asp.net/p/1113541/1787830.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>I did some more research and debugging. It seesm you are correct. The server variables are not set by IIS, because ASP.NET is in control.</p> <p>The URL is: <a href="http://localhost/Ajax/SlideShow/SlideShow.aspx/GetSlides"> http://localhost/Ajax/SlideShow/SlideShow.aspx/GetSlides</a></p> <p>PathInfo is empty string</p> <p>I wonder maybe there is some way to write some generic code if the file does not exist than rewrite and fix PathInfo this way... But than there is a problem that there are rules in URLrewriter.net for some links without the existent path. </p> <p>Maybe just setting&nbsp;PathInfo would help, without actual rewriting, so URLRewriter can do it...</p> 2007-07-05T05:37:15-04:001787856http://forums.asp.net/p/1113541/1787856.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>&nbsp;</p> <p>In fact this was simple, I just copy your solution, but use it with aspx instead... :)</p> <font size="2"></font><font color="#0000ff" size="2">private</font><font size="2"> </font><font color="#0000ff" size="2">void</font><font size="2"> OnBeginRequest(</font><font color="#0000ff" size="2">object</font><font size="2"> sender, </font><font color="#2b91af" size="2">EventArgs</font><font size="2"> e)</font><font size="2"> <p>{</p> </font><font color="#2b91af" size="2">HttpApplication</font><font size="2"> app = sender </font><font color="#0000ff" size="2">as</font><font size="2"> </font><font color="#2b91af" size="2">HttpApplication</font><font size="2">;</font><font size="2"> <p></font><font color="#2b91af" size="2">HttpContext</font><font size="2"> context = app.Context;</p> </font><font color="#0000ff" size="2">string</font><font size="2"> path = context.Request.Path;</font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2">int</font><font size="2"> aspx = path.IndexOf(</font><font color="#a31515" size="2">&quot;.aspx/&quot;</font><font size="2">, </font><font color="#2b91af" size="2">StringComparison</font><font size="2">.OrdinalIgnoreCase);</font><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (aspx &gt;= 0)</font><font size="2"> <p>{</p> <p>context.RewritePath(</p> <p>path.Substring(0, aspx &#43; 5),</p> <p>path.Substring(aspx &#43; 5),</p> <p>context.Request.QueryString.ToString());</p> </font><font color="#0000ff" size="2">return</font><font size="2">;</font><font size="2"> <p>}</p> </font><font color="#0000ff" size="2">int</font><font size="2"> asmx = path.IndexOf(</font><font color="#a31515" size="2">&quot;.asmx/&quot;</font><font size="2">, </font><font color="#2b91af" size="2">StringComparison</font><font size="2">.OrdinalIgnoreCase);</font><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (asmx &gt;= 0)</font><font size="2"> <p>context.RewritePath(</p> <p>path.Substring(0, asmx &#43; 5),</p> <p>path.Substring(asmx &#43; 5),</p> <p>context.Request.QueryString.ToString());</p> <p>}</p> <p>}</p> </font> 2007-07-05T06:04:03-04:001787970http://forums.asp.net/p/1113541/1787970.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>Cool. Glad that worked out for you. [:)]&nbsp;</p> 2007-07-05T07:36:53-04:001794470http://forums.asp.net/p/1113541/1794470.aspx/1?Re+Wildcard+Extensions+RewritePath+and+jsdebugRe: Wildcard Extensions, RewritePath and /jsdebug <p>This is a reply to the original topic in this thread...</p> <p>&nbsp;The HttpModule posted 'sort of' works. It takes care of the Path issue for sure, but it still doesnt address another issue. Say you have a url like <a href="http://localhost/articles/157268/">http://localhost/articles/157268/</a></p> <p>Even though I have my service referenced defined as</p> <p>&lt;asp:ServiceReference Path=&quot;~/ws/PolMach.asmx&quot; /&gt;</p> <p>ASP.NET AJAX isn't rendering the path properly in html. In html it looks like this...</p> <p>&lt;script src=&quot;ws/PolMach.asmx/jsdebug&quot; mce_src=&quot;ws/PolMach.asmx/jsdebug&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>&nbsp;Which is incorrect. It ends up looking to&nbsp;articles/157268/ws/PolMach.asmx.&nbsp; I specified that it should use the file at the root, and it should be written to the page as such. Definately not using a relative path. Chalk this up as another issue overlooked by the devteam. Hopefully it'll be fixed down the road. </p> <p>I have yet to find a dynamic and easily adaptable solution to this. I'll keep tinkering. If someone has some way to get ASP.NET to render that script tag as if it were looking to the root of the site I would really appreciate it if you would share :)</p> <p>&nbsp;</p> <p><em>Edit: </em>&nbsp;It's a very lame, but seemingly easy hack to fix this (hopefully only until the development team provides an actual fix) . I simply copied the output script tag for the webservice (which the ScriptManager generates), removed the service from the ScriptManager control in markup and then added the script tag for the service in the same place in html, prepending the '/' character to the src attribute. Seems to work OK, but is by no means a preferred way of making this work. </p> <p>&nbsp;On a side note, I really wish there was some kind of a progress indicating blog/site which also included release date goals. Would make me feel warm and fuzzy.</p> 2007-07-09T20:25:07-04:00