Rocho.J

人脑是不可靠的, 随时记录感悟并且经常重复!

 

jQuery验证客户端控件, 在提交表单时用MD5.js将密码变成密文

View Code
<script language="javascript" type="text/javascript">
function doSubmit() {
if (!$("#<%=form1.ClientID%>").valid()) {
return false;
}
else {
var pwd = document.getElementById("UserInfoDetail1_txtUserPassword");
var cpwd = document.getElementById("UserInfoDetail1_txtConfirmUserPass");
if (pwd != null && pwd != "") {
pwd.value
= hex_md5(pwd.value);
}
if (cpwd != null && cpwd != null) {
cpwd.value
= hex_md5(cpwd.value);
}
}
}
</script>

后台CS文件中弹提示, 并跳转:

 this.Page.ClientScript.RegisterStartupScript(this.GetType(), "CSharp", "alert('该角色正在使用, 请联系:111或者222!');window.location.href='RoleList.aspx';", true);

posted on 2011-05-30 23:06  RJ  阅读(1206)  评论(1编辑  收藏  举报

导航