日期:2014-05-17 浏览次数:20515 次
<fieldset> <legend>...Or Choose From Your Address Book Entries</legend> <div id="defaultSelected" class="moduleRowSelected"> <div class="back"> <asp:RadioButton ID="rds" runat="server" GroupName="yys" /> <asp:Literal ID="lite" runat="server"></asp:Literal> </div> <div class="back"> </div> </div> <br class="clearBoth"> <address> <asp:Literal runat="server" ID="liyl"></asp:Literal> </address> <asp:Repeater ID="rp_dl" runat="server"> <ItemTemplate> <div id="defaultSelected" class="moduleRowSelected"> <div class="back"> <asp:RadioButton ID='rde' runat="server" GroupName="yys" /> <%# Eval("Y_FirstName")%><%# Eval("Y_LastName") %> </div> <div class="back"> </div> </div> <br class="clearBoth"> <address> <%# Eval("Y_FirstName") %> <%# Eval("Y_LastName") %><br /> <%# Eval("Y_Address")%><br /> <%# Eval("Y_City")%>,<%# Eval("Y_State")%> <%# Eval("Y_Zip")%><br /><%# Eval("Y_Country")%></address> </ItemTemplate> </asp:Repeater> </fieldset>
protected void Button1_Click(object sender, EventArgs e) { //使用模版列里加RadioButton Label1.Text = ""; foreach (GridViewRow gvr in GridView1.Rows) { try { if (((RadioButton)gvr.FindControl("RadioButton1")).Checked) { Label1.Text = "当前选中第" + Convert.ToString(gvr.RowIndex + 1) + "个"; break; } } catch (Exception) { } } if (Label1.Text.Length == 0) { Label1.Text = "没有选中项"; } }