Click here to Skip to main content
15,895,462 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a project, in my project have two pages

1)default.html
2)default.aspx

When i run my project that time load default.aspx page URL like .../.../default.aspx

ok but i want load default.aspx page & i want URL like .../.../default.html

so help me....
Posted
Comments
Ed Nutting 15-Oct-11 8:00am    
If it's an aspx page, the extension has to be .aspx for it to be treated like an aspx page. I fit's an html page then it has to be .html. Html pages are faster because ASP.Net doesn't have to process them at all. They are static pages.

1 solution

well, first of all .aspx and .html pages are way different in their processing. so you can either have an "html" page or an "aspx" page load at any given time. However, if you want just the URL to be changed to html but still process the aspx page internally, then you need to rewrite the URL. Following are some links that tell you how to do URL rewriting in ASP.NET running on IIS.

URL Rewrite in ASP.NET[^]

URL Rewriting with ASP.NET[^]

Hope this helps. Oh and also if you have IIS 7 then you can use something called URL Rewrite within IIS to setup rewriting rules that essentially just change the URL syntactically from anything to anything but still run the right server side code.
For e.g.
PHP
http://www.website.com/blah/params?param1=sdfs
would become
PHP
http://www.website.com/blah/params/sdfs


Hope this helps and hope this is what you wanted...

Cheers.
 
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