Adding user control to a panel.

M

Marc Bishop

i want to repeat a user control multiple times and add each instant to a
panel.

i know to add to the panel
pnlProduct_Display.Controls.Add ()
i call my user control:
<Products:List id="ProductsList_Search" runat="server"/>
and in the code call the sql place it in the control (the control returns a
table with a product):
ProductsList_Search.strSQL = "SELECT * FROM Products WHERE ID=" &
myReader("ID").toString

my question is how do i add multiple instances of this usercontrol to the
panel.
to list product after product after product.?

thanks in advance.
Marc
 
M

Michael Evanchik

dim product as controlyouwant


while rs.read()
product = new controlyouwant
product.id = rs("id")
nlProduct_Display.Controls.Add (product)
end while

Mike
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top