Loading pages into a placeholder

  • Thread starter Thread starter Nicholas Beenham
  • Start date Start date
N

Nicholas Beenham

Hi folks,

I'm new here and to asp .net :(

Can someone tell me how to load pages into a placeholder or point me to a
tutorial or sample code?

Thanks

Nick
 
On your page you put something like this.

<asp:Placeholder id="Pls1" runat="server" />

and in your code one example is something like this.

Dim Box As New TextBox
Box.Text = "0"
AddHandler Box.TextChanged, AddressOf TextBox_Change
Pls1.Controls.Add(Box)

Another example is a literal control like the following.

Pls1.Controls.Add(New LiteralControl(stringControl))
where stringControl in a string variable with the literal text that will be
output to the browser like "<h1>My Heading</h1>"

Hope this helps.

You should also note that conrols added to the page have to be re-added on
postback in most cases.
 
Back
Top