(Douglas Tarr)
1/21/2003 10:09:00 PM
I am using an <asp:dropdown id="MyDropDown"> control, with viewstate
disabled on the page. In the Page_Load event, I have a function that
populates the dropdown from the db.
The form variable name is unique (from INamingContainer) because this
particular webcontrol is wrapped in a UserControl. So the name ends
up looking like: "MyUserControl:MyDropDown" in the form variable
list. Since I have no control over that name, I'm very wary of
referencing the form variable as
Request.Form["MyUserControl:MyDropDown"], because this will change,
if, for instance, I add a second instance of MyUserControl to my
webform (since the names must be unique.
So how do I get the selectedIndex of MyDropDown without referencing
the unique name of the form variable? It always comes up as -1.
Thx,
Doug