Solved

asp.net save page as html

Posted on 2010-08-24
5
313 Views
Last Modified: 2012-08-13
Hi,


Is it possible to save my current .aspx page as html? By any means, like invoke save as dialogue or capture html of page?

Thank you
0
Comment
Question by:mkk39
5 Comments
 
LVL 21

Expert Comment

by:chapmanjw
ID: 33515086
In an automated fashion or just one time?  You could hit CTRL + S on your keyboard to save it while viewing in IE.
0
 

Author Comment

by:mkk39
ID: 33515101
How can I do it using asp.net?
0
 
LVL 21

Expert Comment

by:chapmanjw
ID: 33515164
In ASP.NET you can do a HttpWebRequest to get the content of the HTML that would be sent to a browser and then do whatever you want with it:

string stringURL = "http://www.google.com";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(stringURL);
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
0
 
LVL 7

Expert Comment

by:Alpha Au
ID: 33518762
if  you only need the generated html of you asp.net site, you may use thrid party tools, like HTTrack Website Copier

http://www.httrack.com/

0
 
LVL 5

Accepted Solution

by:
sindhuxyz earned 500 total points
ID: 33519350
Put all tags of html along with data, write it like file with html extension. The html file will be created.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question