I am trying to access a dropdown list control that is in a detailsview:
<asp:TemplateField HeaderText="Person" SortExpression="PersonId">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" Style="position: relative" OnDataBound="DropDownList1_DataBound">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
I am trying to access it to get and set it selectedindex on different events from other controls on the page. I have tried to use
DetailsView1.FindControl("DropDownList1") <-- Also have just tried just FindControl .... no DetailsView1
I always get null. And DropDownList1 fails to show-up in intellisense.
I have looked through other post and other sources but have not seen a direct answer to this problem?
Thank you in advance