1

How to remove (.aspx) extension for Web Form Application?

In need http://example.com/About instead of http://example.com/About.aspx

user2217261
  • 455
  • 7
  • 18

5 Answers5

1

Have you checked this out already? Or even this?

Community
  • 1
  • 1
Vandesh
  • 6,368
  • 1
  • 26
  • 38
1

try url rewriting. you can find refrence here

Purvesh Desai
  • 1,797
  • 2
  • 15
  • 39
1

Really simple thing you can so is:

  1. Create folder named About
  2. Create a copy of About.aspx page and put it in About\Defualt.aspx
  3. Implement redirect from \About.aspx to \About

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.

Maisie John
  • 1,016
  • 9
  • 9
0

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

http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx

https://web.archive.org/web/20211020111718/https://www.4guysfromrolla.com/articles/012710-1.aspx

Ramakrishna.p
  • 1,159
  • 12
  • 31
0

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.