Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 15, 2011 02:48 PM by bruce (sqlwork.com)
Member
131 Points
119 Posts
Aug 15, 2011 12:40 PM|LINK
In my default.aspx, there is a line as below:
<script type="text/javascript" src="PokeIn.ashx?ms=connect" ></script>
in the Global.asax, I wrote as :
routes.IgnoreRoute("{handler}.ashx/{*pathInfo}");
But I found a 404 error, after look up the net captured data, I found the request url as:
Requested URL: /myApp/myAppPokeIn.ashx
and it should be: /myApp/PokeIn.ashx
How to solve it ? thanks.
Aug 15, 2011 12:43 PM|LINK
In addition, I'm using asp mvc 3.
All-Star
20912 Points
3279 Posts
Aug 15, 2011 12:58 PM|LINK
use:
<script src="@Url.Content("~/PokeIn.ashx?ms=connect")" type="text/javascript"></script>
this way you specify the whole path from the root of the application.
Aug 15, 2011 01:17 PM|LINK
Hi, francesco.
As your suggestion, I test <script src="@Url.Content("~/PokeIn.ashx?ms=connect")" type="text/javascript"></script>
but there is a 500 error.
The request head become : GET /Ruge.WebUI_1/@Url.Content( HTTP/1.1
Aug 15, 2011 01:25 PM|LINK
Sure you have inserted my code into a cshtml file? It appears as the @ operator were not processed by the razor engine
...Sorry I see now you are using aspx pagest instead of razor.
Please substitute @.... with <%= .......%>
36850 Points
5445 Posts
Aug 15, 2011 02:48 PM|LINK
the browser is treating "pokein..." as a relative path. change to an absolute path: "/PokeIn...."
wwuzhang
Member
131 Points
119 Posts
Strange Question about route
Aug 15, 2011 12:40 PM|LINK
In my default.aspx, there is a line as below:
<script type="text/javascript" src="PokeIn.ashx?ms=connect" ></script>
in the Global.asax, I wrote as :
routes.IgnoreRoute("{handler}.ashx/{*pathInfo}");
But I found a 404 error, after look up the net captured data, I found the request url as:
Requested URL: /myApp/myAppPokeIn.ashx
and it should be: /myApp/PokeIn.ashx
How to solve it ? thanks.
wwuzhang
Member
131 Points
119 Posts
Re: Strange Question about route
Aug 15, 2011 12:43 PM|LINK
In addition, I'm using asp mvc 3.
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Strange Question about route
Aug 15, 2011 12:58 PM|LINK
use:
<script src="@Url.Content("~/PokeIn.ashx?ms=connect")" type="text/javascript"></script>
this way you specify the whole path from the root of the application.
Mvc Controls Toolkit | Data Moving Plug-in Videos
wwuzhang
Member
131 Points
119 Posts
Re: Strange Question about route
Aug 15, 2011 01:17 PM|LINK
Hi, francesco.
As your suggestion, I test <script src="@Url.Content("~/PokeIn.ashx?ms=connect")" type="text/javascript"></script>
but there is a 500 error.
The request head become : GET /Ruge.WebUI_1/@Url.Content( HTTP/1.1
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Strange Question about route
Aug 15, 2011 01:25 PM|LINK
Sure you have inserted my code into a cshtml file? It appears as the @ operator were not processed by the razor engine
...Sorry I see now you are using aspx pagest instead of razor.
Please substitute @.... with <%= .......%>
Mvc Controls Toolkit | Data Moving Plug-in Videos
bruce (sqlwo...
All-Star
36850 Points
5445 Posts
Re: Strange Question about route
Aug 15, 2011 02:48 PM|LINK
the browser is treating "pokein..." as a relative path. change to an absolute path: "/PokeIn...."