asp.net mvc中,如何把单选框radio的值从一个页面传到另一个页面? 20
比如现在有这些单选框位于页面1中<inputtype="radio"name="radio"id="dd"value="A"/>A.....<br/><inputtype...
比如现在有这些单选框位于页面1中
<input type="radio" name="radio" id="dd" value="A" />A.....<br />
<input type="radio" name="radio" id="dd2" value="B" />B.....<br />
<input type="radio" name="radio" id="dd3" value="C" />C.....<br />
<input type="radio" name="radio" id="dd4" value="D" />D.....<br />
我要把选中的值,也就是value传到页面2中,请问要用怎样的方法? 展开
<input type="radio" name="radio" id="dd" value="A" />A.....<br />
<input type="radio" name="radio" id="dd2" value="B" />B.....<br />
<input type="radio" name="radio" id="dd3" value="C" />C.....<br />
<input type="radio" name="radio" id="dd4" value="D" />D.....<br />
我要把选中的值,也就是value传到页面2中,请问要用怎样的方法? 展开
1个回答
展开全部
您好,您这样:
Protected void Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
{
RadioButton1.AutoPostBack = True; //让RadioButton响应服务端事件.
RadioButton2.AutoPostBack = True;
.....
}
Protected void RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 0;
}
Protected void RadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 1;
}
Protected void Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
{
RadioButton1.AutoPostBack = True; //让RadioButton响应服务端事件.
RadioButton2.AutoPostBack = True;
.....
}
Protected void RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 0;
}
Protected void RadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 1;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询