문제

I want to show a message box when user enters wrong ıd or password. I write following function to the .aspx file:

 <script type="text/javascript">
    function warningMessage() {
        $.msgBox({
            title: "Hatalı Giriş",
            content: "Kullanıcı numarası ya da şifre hatalı...",
            type: "error",
            buttons: [{ value: "Ok" }]              
        });
    }
</script>

and I write the following code to the aspx.cs file:

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "warningMessage  ", "warningMessage()", false);

but this code does not work. Can you help me?

도움이 되었습니까?

해결책

While using this plugin it is necessary to include 3 files:

<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">  

I used this code on client-side:

<script type="text/javascript">
    function warningMessage() {
        $.msgBox({
            title: "Hatalı Giriş",
            content: "Kullanıcı numarası ya da şifre hatalı...",
            type: "error",
            buttons: [{ value: "Okay"}]  
        });
    }
</script>  

On server-side:

Page.ClientScript.RegisterStartupScript(this.GetType(), null, "warningMessage();", true);  

IT WORKS WELL FOR ME

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top