ASP.NET中错误提示框代码怎么写?

2025-05-19 16:35:58
推荐回答(4个)
回答1:

楼上说的都对,不过如果使用了AJAX控件,上面的方法就不灵了,要这样写
System.Web.UI.ScriptManager.RegisterStartupScript(this.updatepanel1, this.GetType(), "unReport", "alert('保存成功!');window.close();", true);
记得重新编译。

回答2:

function check(){
if( document.getElementById("用户输入框ID").value=="")
{
alert("用户名不能为空");
}
}
相关的一些验证 你可以去找找 一些正则表达式.

回答3:

Response.write("");

回答4:

RegisterClientScriptBlock("", "");

RegisterStartupScript("", "");