RadioButton1 ??? 选 RadioButton1 时跳到 页面 1 选 RadioButton2 时跳到 页面 2 请问怎么实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 RadioButton1.Attributes.Add("onclick", "javascript:window.navigate('页面2.aspx')"); 首先要把控件的AutoPostBack设置为true,打开页面回发功能,然后把两个的GroupName写成一样的<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" GroupName="aa" OnCheckedChanged="RadioButton1_CheckedChanged" /> <asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" GroupName="aa" OnCheckedChanged="RadioButton2_CheckedChanged" />代码如下,才可以起到作用 protected void RadioButton1_CheckedChanged(object sender, EventArgs e) { Response.Redirect("1.aspx"); } protected void RadioButton2_CheckedChanged(object sender, EventArgs e) { Response.Redirect("Default2.aspx"); } 楼上的Redirect也可以换成transfer也能实现其效果! 2楼是高手他说 的一定没错我补充一下RadioButton的属性 AutoPostBack="true"还有,为啥你不用RadioButtonList 搞两个控件多麻烦 读取excel的问题 数据库的连接 如何去掉多余的零 我的ASP.NET困惑大全,请朋友们指点 请问为什么TEXTBOX从数据库直接获得数据,缺不能修改 急急急!一个关于水晶报表注册码的问题! 怎样实现把一个表中ID相同的条目合并到一行 请问怎么访问自定义控件的属性! 我的iewebcontrol在win2003下装不上去,为何? 求大神解答 有关testbox的textchange问题 post传值问题
<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" GroupName="aa"
OnCheckedChanged="RadioButton1_CheckedChanged" />
<asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" GroupName="aa"
OnCheckedChanged="RadioButton2_CheckedChanged" />
代码如下,才可以起到作用
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
Response.Redirect("1.aspx");
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
Response.Redirect("Default2.aspx");
}
也能实现其效果!
我补充一下RadioButton的属性 AutoPostBack="true"
还有,为啥你不用RadioButtonList 搞两个控件多麻烦