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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can i get the html of the page multiple times and save as html file and send as attachment

How can i get the html of the page multiple times and save as html file and send as attachment

Scheduled Pinned Locked Moved ASP.NET
questionhtmlsysadminhelp
2 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.
  • K Offline
    K Offline
    K Safvi
    wrote on last edited by
    #1

    hello, On page load event i am generating a report in an aspx file and then capturing the html and saving it as html file to be sent as emil attachemt. This has to be done multiple times for different users. I am overriding the render method of the page to get the html. It works okay for the first time but i need to create the report multiple time. When the below code is called for second time on page load event to capture the newly created report, it gives the error '"A page can have only one server-side Form tag"'. Following the code. Dim sb As New System.Text.StringBuilder Dim sw As New System.IO.StringWriter(sb) Dim hWriter As New HtmlTextWriter(sw) MyBase.Render(hWriter) ' *** store to a string Dim PageResult As String = sb.ToString() ' *** Write it back to the server writer.Write(PageResult) str = PageResult i get error on MyBase.Render(hWriter). Remember its working okay for the first. So how can i get the html of the page multiple times???? Thanks, Safvi

    R 1 Reply Last reply
    0
    • K K Safvi

      hello, On page load event i am generating a report in an aspx file and then capturing the html and saving it as html file to be sent as emil attachemt. This has to be done multiple times for different users. I am overriding the render method of the page to get the html. It works okay for the first time but i need to create the report multiple time. When the below code is called for second time on page load event to capture the newly created report, it gives the error '"A page can have only one server-side Form tag"'. Following the code. Dim sb As New System.Text.StringBuilder Dim sw As New System.IO.StringWriter(sb) Dim hWriter As New HtmlTextWriter(sw) MyBase.Render(hWriter) ' *** store to a string Dim PageResult As String = sb.ToString() ' *** Write it back to the server writer.Write(PageResult) str = PageResult i get error on MyBase.Render(hWriter). Remember its working okay for the first. So how can i get the html of the page multiple times???? Thanks, Safvi

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      Don't post the same question (even if you change a few words) more than once.

      Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells

      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