我想在用户输入错误的密码或密码时显示一个消息框。我将以下函数写入.aspx文件:
<script type="text/javascript">
function warningMessage() {
$.msgBox({
title: "Hatalı Giriş",
content: "Kullanıcı numarası ya da şifre hatalı...",
type: "error",
buttons: [{ value: "Ok" }]
});
}
</script>
我将以下代码写入aspx.cs文件:
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "warningMessage ", "warningMessage()", false);
但此代码不起作用。你能救我吗?
答案 0 :(得分:0)
使用this plugin时,必须包含3个文件:
<script src="Scripts/jquery-2.0.0.js" type="text/javascript"></script>
<script src="Scripts/jquery.msgBox.js" type="text/javascript"></script>
<link href="Styles/msgBoxLight.css" rel="stylesheet" type="text/css">
我在客户端使用了这段代码:
<script type="text/javascript">
function warningMessage() {
$.msgBox({
title: "Hatalı Giriş",
content: "Kullanıcı numarası ya da şifre hatalı...",
type: "error",
buttons: [{ value: "Okay"}]
});
}
</script>
在服务器端:
Page.ClientScript.RegisterStartupScript(this.GetType(), null, "warningMessage();", true);
我的工作对我而言