关于Button事件中赋值变量的问题
时间:2011-12-08
来源:互联网
我用的是VS2003
页面C.aspx上有一个Label7
protected void Button3_Click(object sender, EventArgs e)
{
string s7=3;
Label7.Text=3;
}
if (!Page.IsPostBack)
{
Button3.Attributes.Add("onclick", "if(confirm('你确定要执行这个操作吗?')) window.location='A.aspx?uid="+Label7.Text+"';else window.location='B.aspx'; return false;");
}
我想让Label7的值赋给uid,但是没效果,怎么办?
页面C.aspx上有一个Label7
protected void Button3_Click(object sender, EventArgs e)
{
string s7=3;
Label7.Text=3;
}
if (!Page.IsPostBack)
{
Button3.Attributes.Add("onclick", "if(confirm('你确定要执行这个操作吗?')) window.location='A.aspx?uid="+Label7.Text+"';else window.location='B.aspx'; return false;");
}
我想让Label7的值赋给uid,但是没效果,怎么办?
作者: scorpio78787 发布时间: 2011-12-08
程序运行后A.aspx?uid=
uid后面是空值,也就是说程序只执行Button3按钮中的事件,而没有执行
Button3.Attributes.Add("onclick", "if(confirm('你确定要执行这个操作吗?')) window.location='A.aspx?uid="+Label7.Text+"';else window.location='B.aspx'; return false;");
这句
uid后面是空值,也就是说程序只执行Button3按钮中的事件,而没有执行
Button3.Attributes.Add("onclick", "if(confirm('你确定要执行这个操作吗?')) window.location='A.aspx?uid="+Label7.Text+"';else window.location='B.aspx'; return false;");
这句
作者: scorpio78787 发布时间: 2011-12-08
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28