How to save the to be generated HTML page onto the client's disk in ASP .NET 2.0?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ppuniversal
    New Member
    • Feb 2007
    • 52

    How to save the to be generated HTML page onto the client's disk in ASP .NET 2.0?

    Hi All,
    My question is as follows:

    I have a text box and two links.Let the two links be - Show and Save .

    On clicking the Show , a web page is generated by fetching some data from database according to the input in the textbox and the web page is displayed to the user.

    Now on clicking Save also, with the same input to the textbox, the same set of data will be fetched from the database, but in this case I do not want the web page generated to be displayed to the user, but want a Save dialog box to appear, which the user uses to select any location on his/her system to save the web page generated as HTML format.
    How can I achieve this i.e. how can I save a page which will be generated on clicking the link without first displaying it to the user.

    I have seen code where there is a button in the second web page which can be clicked to save the same page, but I not getting any thing to save the page which will be generated and saved directly.

    I am using ASP .NET with VB .

    Please provide my some solution.
    Thanks
    Pawan
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Why must you save the data in an html file? If all you want is the data you could create an xml file and save the data to that file. If you require the web page as well as the data you could do a screen scrape and save the web page as an image.

    Nathan

    Comment

    • ppuniversal
      New Member
      • Feb 2007
      • 52

      #3
      Originally posted by nateraaaa
      Why must you save the data in an html file? If all you want is the data you could create an xml file and save the data to that file. If you require the web page as well as the data you could do a screen scrape and save the web page as an image.

      Nathan

      Yes, I can store it as XML, and that would be a better idea also. But my assignment wants me to store it in HTML format.

      Comment

      Working...