[英]URL Routing and QueryStrings in ASP.NET Web Forms application
I am trying to implement URL Routing for a non MVC application. 我正在尝试为非MVC应用程序实现URL路由。 Here's my original URL: 这是我的原始网址:
http://mydomain.com/ProcessStuff.aspx?id=1029019
to 至
http://mydomain.com/Process-This-Stuff/1029019
I have difficulty when the page has query strings in the URL. 当页面的URL中包含查询字符串时,我遇到了困难。
This is the route handler I have so far: 这是我到目前为止的路由处理程序:
public class CustomRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return BuildManager.CreateInstanceFromVirtualPath("ProcessStuff.aspx", typeof(Page)) as Page;
}
}
I believe "URL Rewriting Module for IIS" will solve your problem and save you a lot of time! 我相信“ IIS的URL重写模块”将解决您的问题并节省大量时间!
http://www.iis.net/expand/URLRewrite http://www.iis.net/expand/URLRewrite
http://learn.iis.net/page.aspx/460/using-url-rewrite-module/ http://learn.iis.net/page.aspx/460/using-url-rewrite-module/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.