if ("".Equals(userName))//登录检测
{
OutErrorMsg("d020","", "d020");//用户名为空,请重新输入
return "false";
}
protected void OutErrorMsg(string _rgsKey, string _msgTitle, string _errKey)
{
ClientScriptManager objCSM =this.ClientScript;
string content = LanguageManager.GetString(_errKey);
if (!objCSM.IsStartupScriptRegistered("LhgErrorInfoInside"))
{
objCSM.RegisterStartupScript(this.GetType(),"LhgErrorInfoInside", "<script>lhgDialog_PageAlert('ErrorAlert', '', 285, 145, '" + content + "', true, 'error.gif');</script>", false);
}
}
public classLanguageManager
{
*******
}
本文介绍了一种基于C#的Web应用中实现用户登录验证的方法,并展示了如何通过客户端脚本进行错误信息提示,确保用户体验的同时提高系统的健壮性。
935

被折叠的 条评论
为什么被折叠?



