Click here to Skip to main content
15,885,792 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to remove (.aspx) extension from url in asp.net website not in .net project but in asp.net website please help me as soon as possible its urgent.
Ex. www.abc.com/web.aspx i want to remove this .aspx from web.aspx and should be visible as www.abc.com/web only

What I have tried:

RouteTable.Routes.Add(
"ProductRoute",
new Route("Products/{category}/{product}",
new PageRouteHandler("~/Products.aspx")));
/*in global.asas file but it`s not working*/
Posted
Updated 14-Oct-19 0:53am
v5
Comments
dan!sh 2-Mar-16 3:53am    
How do you remove something that does not exist? Can you rephrase the question?
[no name] 2-Mar-16 4:06am    
You are saying about removing .aspx files and url routing. So which way it is related, describe it briefly.
John C Rayan 2-Mar-16 5:25am    
I think OP is trying to map a URL to a aspx page. Can you explain little more clearer ?
Ammar Al-hamdabni 26-Oct-19 6:01am    
why didn't create global.asax and create the routes there?

 
Share this answer
 
Comments
Vijoy Arora 3-Mar-16 8:59am    
but it does not work for web form .
C#
RouteTable.Routes.MapPageRoute("product", "Products/{category}/{product}", "~/Products.aspx");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900