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

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top