开发者

URL Routing and QueryStrings in ASP.NET Web Forms application

开发者 https://www.devze.com 2022-12-21 23:25 出处:网络
I am trying to implement URL Routing for a non MVC application. Here\'s my original URL: http://mydomain.com/ProcessStuff.aspx?id=1029019

I am trying to implement URL Routing for a non MVC application. 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.

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!

http://www.iis.net/expand/URLRewrite

http://learn.iis.net/page.aspx/460/using-url-rewrite-module/

0

精彩评论

暂无评论...
验证码 换一张
取 消