user2217261
user2217261

Reputation: 455

Remove (.aspx) extension for Web Form Application

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

Answers (5)

Munjal Pandya
Munjal Pandya

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

Maisie John
Maisie John

Reputation: 1026

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.

Upvotes: 1

Ramakrishna.p
Ramakrishna.p

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

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

Upvotes: 0

Purvesh Desai
Purvesh Desai

Reputation: 1805

try url rewriting. you can find refrence here

Upvotes: 1

Vandesh
Vandesh

Reputation: 6904

Have you checked this out already? Or even this?

Upvotes: 1

Related Questions