I have a repeater with a dropdownlist in it. When a user changes its index, I would like a label to change its value. (the ddlSizes values come from a MySQL DB)
Sizes.aspx
<asp:DropDownList ID="ddlSizes" runat="server" AutoPostBack="True" DataSourceID="objdsSizes" DataTextField="SizeName" DataValueField="SizeID" />
<asp:Label ID="lbldummy" runat="server" Text=""></asp:Label>
Sizes.aspx.vb
Protected Sub ddlSizes_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlSizes.SelectedIndexChanged
lbldummy = ddlSizes.value
End Sub
But the ddlSizes.SelectedIndexChanged isn’t recognized. So the value of lbldummy won’t change.
Any suggestions? Thank you.
You will want to create the handler for the
DropDownList, within this you need to have code which will convert the sender into aDropDownListthen get the parent control and convert it into theRepeaterItem. From this you can then reference any other controls within theRepeaterItemThen on your ddlSizes DropDownList add
OnSelectedIndexChanged="ddlSizes_SelectedIndexChanged"and make sure it has AutoPostBack=”True” set