简体   繁体   中英

how to hide aspx extension(URL rewriting) using global.asax in asp.net

I am working on URL rewriting using global.asax in asp.net 3.5,

URL:http://localhost:65278/URL_EG2/SubFolder/Home.aspx

I want it to rewrite as: http://localhost:65278/Home

How to acheive this? Can anyone give me simple EG?

I assume you are using ASP.NET web forms.

If you use Routing for Web Forms then you don't need to have extensions on the url. You can have the same routing goodness experienced by the MVC apps in your web forms applicaiton as well.

Check here to learn more about Routing for ASP.NET Web Forms

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM