Custom File Extension in ASP.NET?

Posted by Peermohamedmydeen under ASP.NET on 9/20/2010 | Points: 10 | Views : 2212 | Status : [Member] | Replies : 1
Hi Friends,

Nice Day,

I am having an ASP.NET web application, in which I have few .aspx files.

I don't want to expose .aspx file extension to user in the URL. I want to give a customized file extension which can be easily changeable time to time.

Eg :

Instead of http://www.xyz.com/MyHome.aspx. I want to show http://www.xyz.com/MyHome.mydeen

This extension can be changeable without much effort.

Please help me.




Responses

Posted by: SheoNarayan on: 9/20/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Not sure if you had attended yesterday's ASP.NET 4.0 In-Depth online session (http://www.dotnetfunda.com/misc/onlinesession.aspx ), there Abhishek was explaining about Url routing. Using URL Routing you can achieve this very easily.

Read this article that should guide you http://www.dotnetfunda.com/articles/article870-a-walkthrough--to-aspnet-40-url-routing-.aspx

To see the example,

visit http://www.itfunda.com/Pages/9/Corporate-Training and modified link http://www.itfunda.com/Pages/9/Corporate-Training.itfunda link, notice the extension .itfunda both links will give the same page.

Hope this will help.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Peermohamedmydeen, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response