I have a label and dropdownlist inside a repeater. When I click a button outside the repeater I would like to access the label.Text value and ddl.SelectedIndex value.
<asp:Repeater ID="rptProduct" runat="server" DataSourceID="objdsProduct" OnItemCommand="rptProduct">
<ItemTemplate>
<div>
<div>
<asp:Label ID="lblProdName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
</div>
<div>
<asp:DropDownList ID="ddlSize" runat="server" AutoPostBack="False" DataSourceID="objdsSize" DataTextField="SizeName" AppendDataBoundItems="True" DataValueField="SizeID">
<asp:ListItem Text="select a size" Value=0></asp:ListItem>
</asp:DropDownList>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:Button ID="btnChoose" runat="server" Text="Choose Products" />
Any suggestions how I can access lblProdName.Text and ddlSize.SelectedValue within:
Protected Sub btnChoose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnChoose.Click
Dim ProductName
Dim Size
End Sub
Thank you for your time.
Add this to your button click: