Jeffrey:
Typically you stick a placeholder control and then dynamically build your
controls, placing them inthe placeholder..
....
<form>
<asp:placeholder id="content" runat="server" />
</form>
codebehind:
protected content as PlaceHolder
page_load
dim table as new HtmlTable
dim row as new HtmlTableRow
dim cell as new HtmlRableCell
cell.InnerText = "Hello"
row.Cells.Add(cell)
cell = new HtmlTableCell
cell.InnerText = "World"
row.Cells.Add(cell)
table.Rows.Add(row)
content.Controls.Ad(table)
end sub
or, if you are looping through records, use a repeater/datagrid/datalist.
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"UJ" <fr**@nowhere.com> wrote in message
news:uY*************@TK2MSFTNGP09.phx.gbl...
I'm a newbie to this so please excuse the level of question. My question
is how can I dynamically create a table in the middle of a page without
having to build the entire page dynamically? I have code to build the
string that will generate the table. (This is all to solve the problem of
when a person clicks a checkbox in a datagrid, there's no way of knowing
what record it belongs to - see my previous post)
Here's what my code would look like ideally:
<html>
<body>
<form>
Isn't this a pretty page?
(Some kind of code that would build all the controls I need.
Ideally this code would be a function that is in the codebehind page)
Done creating my stuff.
</form>
</body>
<html>
Thanks again in advance.
Jeffrey.