Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to save aspx page as html

How to save aspx page as html

Scheduled Pinned Locked Moved ASP.NET
htmlhelptutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dharanighanta
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • D dharanighanta

      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.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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.


      My Website | Ask smart questions

      D 1 Reply Last reply
      0
      • N N a v a n e e t h

        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.


        My Website | Ask smart questions

        D Offline
        D Offline
        dharanighanta
        wrote on last edited by
        #3

        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?

        N 1 Reply Last reply
        0
        • D dharanighanta

          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?

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          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 ?


          My Website | Ask smart questions

          D 1 Reply Last reply
          0
          • N N a v a n e e t h

            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 ?


            My Website | Ask smart questions

            D Offline
            D Offline
            dharanighanta
            wrote on last edited by
            #5

            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.

            N 1 Reply Last reply
            0
            • D dharanighanta

              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.

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              After saving the file open it using javascript and remove these unwanted image tags. Check this[^] for opening files in javascript.


              My Website | Ask smart questions

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups