簡體   English   中英

jQuery msgBox在代碼后面的執行(C#)

[英]jquery msgBox execution in code behind(c#)

當用戶輸入錯誤的ıd或密碼時,我想顯示一個消息框。 我將以下函數寫入.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);

但是此代碼不起作用。 你能幫助我嗎?

使用此插件時 ,必須包含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);  

這對我來說很有效

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM