I need to access the properties of a control that is nested in 2 datalists.
How do you use findcontrol method to do that?
what I have is like this:
<asp:datalist id="dlist" runat="server">
<edititemtemplate>
<asp:datalist id="dlistdet" runat="server">
<asp:dropdownlist id="ddlTypes" runat="server"></dropdownlist>
</asp:datalist>
</edititemtemplate>
</asp:datalist>
Every thing loads fine. The ddlTypes is loaded from a database and I
can see it's results. I need to access the selected value on it
directly. I am able to access a control from within the first dlist by
using:
neededitem = CType(e.Item.FindControl("controlname"), TextBox)
But what is the syntax to drill down further into that edititemtemplate
and the dlistdet? Also, I am running this from the event
SelectedIndexChanged
on the dropdownlist, and I dont have the e.item.findcontrol. what I am
trying is something like this:
Dim ddl As DropDownList =
CType(dlist.Items(dlist.SelectedIndex).FindControl ("ddlTypes"),
DropDownList)
But that isnt working. Not sure what it's supposed to look like.
Thank you for the assistance!
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com