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. Using Response.Write in Page_Load handler

Using Response.Write in Page_Load handler

Scheduled Pinned Locked Moved ASP.NET
questionhtml
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.
  • G Offline
    G Offline
    Gary Hyslop at home
    wrote on last edited by
    #1

    I wish to construct a dynamic table by using Response.Write in the code behind (Page_Load) to construct an HTML table. When the page is rendered, it looks somewhat OK except that "View Source" reveals that the dynamic HTML is at the top PRECEDING the DOCTYPE line. How can I place the dynamic HTML table where I want it - between the form tags?

    G 1 Reply Last reply
    0
    • G Gary Hyslop at home

      I wish to construct a dynamic table by using Response.Write in the code behind (Page_Load) to construct an HTML table. When the page is rendered, it looks somewhat OK except that "View Source" reveals that the dynamic HTML is at the top PRECEDING the DOCTYPE line. How can I place the dynamic HTML table where I want it - between the form tags?

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      If you want to use Response.Write like that from Page_Load, you have to output the entire page using Response.Write. Create the html code for the table in a string or StringBuilder. Then put the code in the InnerHtml property of a placeholder, like a div tag with runat="server". --- b { font-weight: normal; }

      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