window.confirm 弹出窗口中获取变量的值 但是总是空的
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Radio1.Checked = true;
//Button1.Attributes.Add("onclick", "if(window.confirm('你选择的餐别为:" + str.ToString() + " 是否确认全月报餐?')){ this.disabled='true';" + GetPostBackEventReference(Button1) + "; return true;} else { this.disabled=false; return false; }");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Radio1.Checked == true)
{
str = "早,中,晚";
Session["num"] = str.ToString();
}
else if (Radio2.Checked == true)
{
str = "早,中";
}
else if (Radio3.Checked == true)
{
str = "早,晚";
}
else if (Radio4.Checked == true)
{
str = "中";
}
else if (Radio5.Checked == true)
{
str = "晚";
}
}
我想让点击Button1的时候弹出这个窗体,这个现在已经实现了,但是还需要在弹出来的内容上有str的值,但是这里一直是空的,谁能帮我解决下,谢谢。