Access Data in UserControl

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

Guest

I am trying to access the SelectedIndex property of DropDownList but the
dropDownList is in a UserControl.

I'm sure this is very simple but I can't work it out :o( please help.

John
 
John:
Check out:
http://openmymind.net/index.aspx?documentId=9

Normally, you would simply expose a property in the user control, such as
public class SomeControl inherits UserControl

property readonly SelectedIndex as Integer
get
return ddl.SelectedIndex
end get
end property


which you can access from your page, by simple doing

protected myControl as SomeControl 'this is just the declaration you
already have in your page...


sub void someClick(...)
dim x as integer myControl.SelectedIndex
end sub

Karl
 

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

Back
Top