Click to See Complete Forum and Search --> : User control problems


trekmp
April 2nd, 2004, 10:11 AM
I've made a custom control that makes use of the dropdownlist and gets values from a database and this all works fine. I can pass a value to it no problem.

My problem is I've got the user control inside of a datalist and its repeated several times again with no problem.

I'm doing a simple test of looping through each item in the datalist and displaying their values. I've got labels, textboxs,checkboxs and my one user control. I can get the values by doing Dim ctr_Name As Label=CType(dlItem.FindControl("lblName"),Label) and this works fine for everything, but I cannot get it to work for my Control, which has an ID="cmbDept"

Anyone know how to get around this.

Craig Gemmill
April 2nd, 2004, 11:17 AM
Is it a Web User control, or a Web Custom control? I'm pretty sure only a Custom control will do what you want.

trekmp
April 5th, 2004, 03:46 AM
Its a user control, I haven't got to the stage to create server custom controls yet.