我在Default.aspx.cs写了
protected void Button1_Click(object sender, EventArgs e)
{
this.Response.Write( " <script language= 'JavaScript '> alert( '弹出窗口! ');window.location= 'xinyaoruku.aspx '; </script> ");
}
可是不起作用,还报错!
请详细帮助本菜鸟!谢谢!!
------解决方案--------------------------------------------------------
如果是用了AJAX,请照下例:
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click ", "alert( '短信内容太长,超过70字符限制! ') ", true);
return;