有两个groupbox,里面分别有几个radiobutton,如何分别选择两个radiobutton,label的text能够同步变化

是windowform
2024-11-29 14:53:17
推荐回答(1个)
回答(1):

页面 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> 无标题页


后台 using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void RadioButton1_CheckedChanged(object sender, EventArgs e) { if (this.RadioButton1.Checked) { this.Label1.Visible = true; this.TextBox1.Visible = true; } else { this.Label1.Visible = false; this.TextBox1.Visible = false; } } } ps:注意 radiobutton的autopostback属性,要设置成true