Reputation: 455
How to remove (.aspx) extension for Web Form Application?
In need http://example.com/About instead of http://example.com/About.aspx
Upvotes: 1
Views: 4414
Reputation: 115
You need to implement ASP.Net Routing. In ASP.Net Routing, you need to register routes for the pages for which you need to hide .aspx extension.
You can find more on ASP.Net routing at following blog series:
http://karmic-development.blogspot.in/2013/10/url-routing-in-aspnet-web-forms-part-1.html
http://karmic-development.blogspot.in/2013/10/url-routing-in-aspnet-web-forms-part-2.html
http://karmic-development.blogspot.in/2013/10/url-routing-in-aspnet-web-forms-part-3.html
You can check the whole series, with various practical scenarios.
Upvotes: 0
Reputation: 1026
Really simple thing you can so is:
This way you can use www.yoursite.com\about without any issues.
Now, if you’re trying to do this for many pages then you might want to consider url rewriting and such but if its only one page I wouldn’t really bother.
Upvotes: 1
Reputation: 1201
use concept called ASP.NET routing that enables you to use URLs that do not have to map to specific files in a Web site.You can use URLs that are descriptive of the user's action and therefore are more easily understood by users.
Refer More about
http://msdn.microsoft.com/en-us/library/cc668201.ASPX
http://www.codeproject.com/Articles/77199/URL-Routing-with-ASP-NET-4-0
https://web.archive.org/web/20211020111718/https://www.4guysfromrolla.com/articles/012710-1.aspx
Upvotes: 0