Placeholder and positioning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Guys,

I am having difficult time with the placeholders. I have
a placeholder which gets loaded with listbox at run time.

I want the listbox to be displayed on a cell in the
table. Now how can I place the listbox which is generated
at run time in the cell. I tried using a Panel in the
cell and adding the placeholder to that panel but it
never works.

My ultimate goal is to be able to position the server
controls which are generated dynamically.

Can anyone help me out?

Thanks a bunch!!!
 
Hi,

Just forget about the PlaceHolder and Panel. Take the <TD> of the cell you
want to add the DropDownList to, add a runat="server" attribute and an
id="myCell" attribute. In your code, write in the Page_Init:
Dim myCell as HtmlTableCell = FindControl("myCell")
myCell.Controls.Add(DropDownList1) ' (or whatever the name)

You're done!
 
Back
Top