Placeholder and positioning

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!!!
 
A

AW

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top