Hello,
I have a placeholder inside an update panel as showing in the below Code block.
I dynamically create some Comboboxes as showing below
I also have a submit button.
I want to get the selected value of the dropdownlist when the button is clicked.
I tried
but it didn't work. I also tried
but it didnt either work.
The controls of the Fields placeholder seems to be nothing in both approaches.
Could you please help me?
Thanks in advance,
Peny
I have a placeholder inside an update panel as showing in the below Code block.
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel36" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:PlaceHolder runat="server" ID="Fields">
</asp:PlaceHolder>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList2" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>.....
Dim dropDownList As DropDownList
dropDownList = New DropDownList
dropDownList.ID = array_action_ids(i)
dropDownList.Visible = True
dropDownList.DataSourceID = "SqlDataSource2"
dropDownList.DataTextField = "LEGAL_PHONE_NUMBER"
dropDownList.DataValueField = "LEGAL_PHONE_ID"
Fields.Controls.Add(GetLiteral("<td>"))
Fields.Controls.Add(dropDownList)
Fields.Controls.Add(GetLiteral("</td>"))
..... I also have a submit button.
I want to get the selected value of the dropdownlist when the button is clicked.
I tried
Dim dropdownlist_phone As DropDownList = CType(Fields.FindControl("DropDownList_Phone"), DropDownList)but it didn't work. I also tried
Dim temp_Placeholder as Placeholder = CType(UpdatePanel36.FindControl("Fields"), Placeholder)
Dim dropdownlist_phone As DropDownList = CType(temp_Placeholder.FindControl("DropDownList_Phone"), DropDownList)but it didnt either work.
The controls of the Fields placeholder seems to be nothing in both approaches.
Could you please help me?
Thanks in advance,
Peny