Modifying html in codebehind

  • Thread starter Thread starter Rick Morayniss
  • Start date Start date
R

Rick Morayniss

I am trying HtmlTextWriter, but I cant get it to work.
I need to manipulate a html table through codebehind. If I could write the
html page, everything would be fine. Please help.
 
Drop a table control on your form, and programmatically add rows, cells and
content to it in the code-behind. When the page is rendered, the table will
be rendered as a child control, and you won't need to explicitly emot any
HTML.
 
You can do so either by a) Overriding Render or RenderChildren
or by Making the Table an <table runat="server" id="tblMyTable"> and then
making sure there is a definition in your WebForm's Code View like
System.Web.UI.HtmlControls.HtmlTable tblMyTable ;

And then modifying its properties via CodeBehind that way.
Please note that this code was written without the assist of VA.NET & VS.NET
Intellisense so it may contain typographical errors.

Hope it helps
 
Back
Top