D
DaveF
I have a textbox in a user control that a put in a aspx page. How do I get a
referance to that textbox from my aspx page?
referance to that textbox from my aspx page?
protected void submit_Click(object sender, EventArgs e)
{
foreach (RepeaterItem riRating in this.Questions.Items)
{
RadioButtonList rating = (RadioButtonList)riRating.FindControl("rbList");
Label1.Text += rating.SelectedIndex.ToString() + "</br>";
}
}
<asp:Repeater ID ="Questions" runat="server">
<ItemTemplate>
<table>
<tr style ="border-bottom-color:black">
<td colspan="3" style="height: 20px">
<asp:Label ID="Label1" runat="server"></asp:Label>
<b><%# DataBinder.Eval(Container.DataItem, "Question")%>
</b>
</td>
</tr>
<tr>
<td style="width: 63px; height: 20px">
Not Good</td>
<td style="width: 22px; height: 20px">
<asp:RadioButtonList ID="rbList" runat="server" AutoPostBack="False" BorderStyle="none"
Height="34px"
RepeatDirection="Horizontal" Width="44px ">
<asp:ListItem Value="1"></asp:ListItem>
<asp:ListItem Value="2"></asp:ListItem>
<asp:ListItem Value="3"></asp:ListItem>
<asp:ListItem Value="4"></asp:ListItem>
<asp:ListItem Value="5"></asp:ListItem>
<asp:ListItem Value="6"></asp:ListItem>
<asp:ListItem Value="7"></asp:ListItem>
<asp:ListItem Value="8"></asp:ListItem>
<asp:ListItem Value="9"></asp:ListItem>
<asp:ListItem Value="10"></asp:ListItem>
</asp:RadioButtonList></td>
<td style="width: 45px; height: 20px">
Excellent</td><br />
<td style="width: 45px; height: 20px"><br />
<asp:Label ID="lblAnswer" runat="server" Visible="true" Text=""></asp:Label></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<asp:Button ID="submit" Text="Submit" runat="server" OnClick="submit_Click"/>
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.