How to convert .aspx file to .html file in a output
Hi Friends,
I have one doubt that how to convert .aspx file to .html file in asp.net. I am writing a code in a asp.net using c#.In the browser the output displayed by .aspx files.But i want to convert .html and view the browser in html file.Is it possible?
:)
Re: How to convert .aspx file to .html file in a output
Quote:
Originally Posted by Guvera
Hi Friends,
I have one doubt that how to convert .aspx file to .html file in asp.net. I am writing a code in a asp.net using c#.In the browser the output displayed by .aspx files.But i want to convert .html and view the browser in html file.Is it possible?
:)
Why will you do that? The ASPX file is rendered as HTML on the clients browser, so what is the need of converting it to HTML file?
Re: How to convert .aspx file to .html file in a output
You're not making a lot of sense, but could you perhaps mean that you want it to execute with the codebehind but use a .html extension? Then perhaps what you need is URL rewriting.
Re: How to convert .aspx file to .html file in a output
I'm sorry mendhak. what is URL rewriting? is it a library in vs2005?
Re: How to convert .aspx file to .html file in a output
URL rewriting is a way of 'mapping' a non-existent URL to an actual URL. For example, you may have www.site.com/products/products.aspx?type=jeans
To make it more search engine friendly, one may want to turn this into a URL such as:
www.site.com/products/jeans.html
jeans.html won't actually exist, but your URL Rewriting procedure will take care of that URL and make sure it maps to products.aspx?type=jeans
It is a 'feature' of ASP.NET
Re: How to convert .aspx file to .html file in a output
Quote:
Originally Posted by Guvera
Hi Friends,
I have one doubt that how to convert .aspx file to .html file in asp.net. I am writing a code in a asp.net using c#.In the browser the output displayed by .aspx files.But i want to convert .html and view the browser in html file.Is it possible?
:)
Do you want to fetch the rendered HTML out of an .aspx page?
Re: How to convert .aspx file to .html file in a output
Quote:
Originally Posted by mendhak
URL rewriting is a way of 'mapping' a non-existent URL to an actual URL. For example, you may have
www.site.com/products/products.aspx?type=jeans
To make it more search engine friendly, one may want to turn this into a URL such as:
www.site.com/products/jeans.html
jeans.html won't actually exist, but your URL Rewriting procedure will take care of that URL and make sure it maps to products.aspx?type=jeans
It is a 'feature' of ASP.NET
Oh, yes. Thank you, Mendhak.
I wonder vs 2005 have this feature or not? If they have, which namespace or class will do that for me?
Can you tell me, Mendhak?
Re: How to convert .aspx file to .html file in a output
Re: How to convert .aspx file to .html file in a output
Since you're using VS 2005, in other words, ASP.NET 2.0, keep in mind the new feature: URL Mapping.
This is very similar to URL Rewriting, except that you are explicitly giving one to one mappings. If you have just one or two URLs to be rewritten, use URL Mapping. Else, use URL Rewriting.