Response.write in UserCOntrol

  • Thread starter Thread starter Peter Aitken
  • Start date Start date
P

Peter Aitken

In my usercontrol I want to use response.write in code behind to write HTML
to the page. However it outputs at the top of the page and I want the output
at the bottom, beneath the controls. How can I do this? Or is there a better
way than response.write to do what I want?
 
All HTML in an ASP.Net page is objects on the server at runtime (yes, even
"static" HTML). ASP.Net is object-oriented. Response.Write is procedural.
For this reason, a Page is populated by creating objects and placing them in
its Controls Collection. The properties of the objects create the HTML in
the page.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Kevin Spencer said:
All HTML in an ASP.Net page is objects on the server at runtime (yes, even
"static" HTML). ASP.Net is object-oriented. Response.Write is procedural.
For this reason, a Page is populated by creating objects and placing them in
its Controls Collection. The properties of the objects create the HTML in
the page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP

Thanks. I discovered that I can do what I want by including the following
tag on the page:

<span id="report" runat="server"></span>

Then including this code in the code behind:

report.innerHTML="whatever"
 
Back
Top