response.write 问题 protected void login_Click(object sender, ImageClickEventArgs e) { if (b == a) { Server.Transfer("Index.aspx"); } else { Response.Write("<script language=javasript>alert('密码错误')<"+"/script>"); } }为什么此处不会跳出弹窗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你最好使用Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('密码错误')", true);另外,条件满足了啊 protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { if (0 == RebootAXIS(MachineIp.Ip)) { //MessageBox.Show("Reboot successfully."); Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('Reboot successfully.')", true); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('Failed to reboot the DVS.')", true); } }使用了 但是还是不跳出来 是不是浏览器block了弹出窗口? 1、Response.Write("<script>alert('密码错误')</script>");2、Page.ClientScript.RegisterStartupScript(this.GetType(),"","alert('密码错误')",true);这2个都可以。你调试下,是不是条件没满足?没有执行 另外页面是什么?使用了UpdatePanel? 老大,知道了,这样就可以了ScriptManager.RegisterStartupScript(this.btnOK, this.GetType(), "alert", "alert('添加信息成功!');", true); 使用了UpdatePanel,得使用这种方式ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('123');", true); .net 小问题 Response.End() 与 return 等价? 令人头大如斗的数据统计查询,数据库高手给指点指点)))))))))))))))))))))))) 问高手一个关于CheckBox使用期问题. 求助:网页不能直接打开 请问access的连接字符串如何写在web.config里? Asp.net 页面导航的几种方法与比较 刚学。NET是选取VB,还是C#,比较好?矛盾中。。。。。。请指点 谁能帮我改改 jeasy ui 的datagrid 中URL地址不能用。。/这样吗 有关于一个PostBackUrl的问题,我是新手,请多多关照 怎样在IIS虚拟目录下配置伪静态
Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('密码错误')", true);
另外,条件满足了啊
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (0 == RebootAXIS(MachineIp.Ip))
{
//MessageBox.Show("Reboot successfully.");
Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('Reboot successfully.')", true);
}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "ks", "alert('Failed to reboot the DVS.')", true);
}
}
使用了 但是还是不跳出来
2、Page.ClientScript.RegisterStartupScript(this.GetType(),"","alert('密码错误')",true);
这2个都可以。你调试下,是不是条件没满足?没有执行
老大,知道了,这样就可以了
ScriptManager.RegisterStartupScript(this.btnOK, this.GetType(), "alert", "alert('添加信息成功!');", true);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('123');", true);