Strange Question about routehttp://forums.asp.net/t/1710708.aspx/1?Strange+Question+about+routeMon, 15 Aug 2011 14:48:51 -040017107084554204http://forums.asp.net/p/1710708/4554204.aspx/1?Strange+Question+about+routeStrange Question about route <p>In my default.aspx, there is a line as below:</p> <p>&nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;PokeIn.ashx?ms=connect&quot; &gt;&lt;/script&gt;</p> <p>in the Global.asax, I wrote as :&nbsp;</p> <p>&nbsp; &nbsp; routes.IgnoreRoute(&quot;{handler}.ashx/{*pathInfo}&quot;);&nbsp;</p> <p>But I found a 404 error, after look up the net captured data, I found the request url as:</p> <p>&nbsp; &nbsp; Requested URL: &nbsp;/myApp/myAppPokeIn.ashx</p> <p>&nbsp; &nbsp; and it should be: /myApp/PokeIn.ashx</p> <p>How to solve it ? thanks.&nbsp;</p> 2011-08-15T12:40:59-04:004554206http://forums.asp.net/p/1710708/4554206.aspx/1?Re+Strange+Question+about+routeRe: Strange Question about route <p>In addition, I'm using asp mvc 3.</p> 2011-08-15T12:43:14-04:004554233http://forums.asp.net/p/1710708/4554233.aspx/1?Re+Strange+Question+about+routeRe: Strange Question about route <p>use:</p> <p>&lt;script src=&quot;@Url.Content(&quot;~/PokeIn.ashx?ms=connect&quot;)&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>this way you specify the whole path from the root of the application.</p> 2011-08-15T12:58:04-04:004554263http://forums.asp.net/p/1710708/4554263.aspx/1?Re+Strange+Question+about+routeRe: Strange Question about route <p>Hi, francesco.&nbsp;</p> <p>As your suggestion, I test &lt;script src=&quot;@Url.Content(&quot;~/PokeIn.ashx?ms=connect&quot;)&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</p> <p>but there is a 500 error.</p> <p>The request head become : &nbsp;GET /Ruge.WebUI_1/@Url.Content( HTTP/1.1</p> 2011-08-15T13:17:20-04:004554271http://forums.asp.net/p/1710708/4554271.aspx/1?Re+Strange+Question+about+routeRe: Strange Question about route <p>Sure you have inserted my code into a cshtml file? It appears as the @ operator were not processed by the razor engine</p> <p>...Sorry I see now you are using aspx pagest instead of razor.</p> <p>Please substitute @.... with &lt;%= .......%&gt;</p> 2011-08-15T13:25:01-04:004554394http://forums.asp.net/p/1710708/4554394.aspx/1?Re+Strange+Question+about+routeRe: Strange Question about route <p>the browser is treating &quot;pokein...&quot; as a relative path. change to an absolute path: &quot;<strong>/</strong>PokeIn....&quot;</p> <p></p> 2011-08-15T14:48:51-04:00