system.web.routing

Asp.Net System.Web.Routing Find actual .aspx Page

徘徊边缘 提交于 2019-12-21 17:23:58
问题 I'm using System.Web.Routing to have some better URL's and have come across a problem. I need to know the actual page that's handling the request. for example a request comes in as: /basketball/home I need to find the page that handles that request, like: /management/default.aspx I'm only using the System.Web.Routing and not MVC. I have a handle to the RequestContext that contains some of the route information, but i don't see what i need. Thanks in advance. ******* UPDATE ******* I was able

CSS bindings while using url routing

拜拜、爱过 提交于 2019-12-11 14:56:39
问题 I have asp .net 4.0 application in which i am implementing url routing. I have defined my routes in global asax and able to call them correctly. but my problem is when I am calling a route with parameters my css was not binded properly . I linked my css files as follows in my master page. <link id="Link1" rel="stylesheet" type="text/css" href="~/css/style.css" runat="server" /> <link id="Link2" rel="stylesheet" type="text/css" href="~/css/menu.css" runat="server" /> when i am calling a route

Asp.Net System.Web.Routing Find actual .aspx Page

半腔热情 提交于 2019-12-04 10:12:06
I'm using System.Web.Routing to have some better URL's and have come across a problem. I need to know the actual page that's handling the request. for example a request comes in as: /basketball/home I need to find the page that handles that request, like: /management/default.aspx I'm only using the System.Web.Routing and not MVC. I have a handle to the RequestContext that contains some of the route information, but i don't see what i need. Thanks in advance. ******* UPDATE ******* I was able to use Context.CurrentHandler which give me "ASP.management_default_aspx" , not exactly the page but

Failing ASP.NET MVC route. Is this a bug or corner case?

梦想的初衷 提交于 2019-12-03 05:11:23
问题 I have an ASP.NET MVC 3 application where users can post suggestions along the lines of "bla bla would be better if yada yada yada". For the suggestion detail page I have defined a nice SEO friendly route as follows: routes.MapRoute(null, "suggestion/{id}/{it}/would-be-better-if-{if}", new { controller = "suggestion", action = "details" }); As you can see I want the "would be better if" part to be fixed. This route works perfectly for any old suggestion and generates links like suggestion/5

Failing ASP.NET MVC route. Is this a bug or corner case?

谁都会走 提交于 2019-12-02 18:25:41
I have an ASP.NET MVC 3 application where users can post suggestions along the lines of "bla bla would be better if yada yada yada". For the suggestion detail page I have defined a nice SEO friendly route as follows: routes.MapRoute(null, "suggestion/{id}/{it}/would-be-better-if-{if}", new { controller = "suggestion", action = "details" }); As you can see I want the "would be better if" part to be fixed. This route works perfectly for any old suggestion and generates links like suggestion/5/this-site/would-be-better-if-it-had-a-iphone-application , and clicking on the link actually requests