日期:2014-05-18  浏览次数:20401 次

这句哪里错了,,,为什么就不行呢,,,求助。。。急死人啊呀呀呀,,,
后台cs文件的按钮点击事件中:


protected void bt_123_Click(object sender, EventArgs e)
  {
if(aa=bb)
{
  ...
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "if(return confirm('还没有登录,确认现在登录帐户吗?')==true){window.location.href='../bbs/login.aspx';}else{return false;}", true);
}
}

为什么弹不出信息框啊,,,急。。。。。

正确的应该怎么写啊?求大侠们帮助。。。。





------解决方案--------------------
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "if(confirm('还没有登录,确认现在登录帐户吗?'))window.location.href='../bbs/login.aspx';", true);

另外,你这是在Updatepanel里面使用的吗
------解决方案--------------------
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "if(confirm('还没有登录,确认现在登录帐户吗?')){window.location.href='../bbs/login.aspx';}else{return false;}", true);
------解决方案--------------------
if(aa=bb)
应该是if(aa==bb)吧
------解决方案--------------------
你里面的脚本写错了,

整个代码也可以这样写
Page.ClientScript.RegisterStartupScript(Page.GetType(), "提示", "if(confirm('还没有登录,确认现在登录帐户吗?'))window.location.href='../bbs/login.aspx';", true);
------解决方案--------------------
http://www.cnblogs.com/huanhuan86/archive/2012/02/25/2367678.html
检查一下你的页面里是否有UpdatePanel控件