How to save aspx page as html
-
Hi All, I have to save the webpage as html.In tht page, i have images,text and three buttons.The buttons like Print,Save As HTML and Close.If user click the save as html button then a save dialogbox should open and user'll give some file name for save that page.I got upto here but in that html page i am containg those three buttons.How to hide those buttons in save as html page.Plz give me solution for my problem...Its very urgent for now... Thanks in advance. Regards, Dharani.
-
Hi All, I have to save the webpage as html.In tht page, i have images,text and three buttons.The buttons like Print,Save As HTML and Close.If user click the save as html button then a save dialogbox should open and user'll give some file name for save that page.I got upto here but in that html page i am containg those three buttons.How to hide those buttons in save as html page.Plz give me solution for my problem...Its very urgent for now... Thanks in advance. Regards, Dharani.
dharanighanta wrote:
If user click the save as html button then a save dialogbox should open and user'll give some file name for save that page
Saving HTML page to client machine ? To remove those images, you need to look for images to be removed using regular expression and replace it with blank value.
-
dharanighanta wrote:
If user click the save as html button then a save dialogbox should open and user'll give some file name for save that page
Saving HTML page to client machine ? To remove those images, you need to look for images to be removed using regular expression and replace it with blank value.
Thanks for the reply. Saving HTML page to client machine.I am getting images in that html page.whats my problem is in that page i am having 3 buttons.How to hide those buttons in html page?
-
Thanks for the reply. Saving HTML page to client machine.I am getting images in that html page.whats my problem is in that page i am having 3 buttons.How to hide those buttons in html page?
dharanighanta wrote:
i am having 3 buttons.How to hide those buttons in html page?
I presume that you know all these 3 buttons name. When you are creating HTML find these names and replace it with blank value. Still I didn't understand how you will save HTML file to client machine, I don't think that ASP.NET will be having write permission on client drives ?
-
dharanighanta wrote:
i am having 3 buttons.How to hide those buttons in html page?
I presume that you know all these 3 buttons name. When you are creating HTML find these names and replace it with blank value. Still I didn't understand how you will save HTML file to client machine, I don't think that ASP.NET will be having write permission on client drives ?
Sorry,Html page'll save in local systems only. I am calling the following javascript function on the save as html button click event
function saveashtml()
{
window.document.execCommand('SaveAs',false,'C:\\file.html');
}This function simply reads the entire page and save it into html page.
-
Sorry,Html page'll save in local systems only. I am calling the following javascript function on the save as html button click event
function saveashtml()
{
window.document.execCommand('SaveAs',false,'C:\\file.html');
}This function simply reads the entire page and save it into html page.
After saving the file open it using javascript and remove these unwanted image tags. Check this[^] for opening files in javascript.