Total Pageviews

Sunday 5 July 2015

Beautiful alert box for asp.net button click

http://www.jqueryscript.net/demo/Stylish-jQuery-Notification-Alert-Plugin-Smart-Alert/quick-start/



Download link- http://www.jqueryscript.net/download/Stylish-jQuery-Notification-Alert-Plugin-Smart-Alert.zip
Code:
--------
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>

    <link href="css/alert.css" rel="stylesheet" />
    <link href="css/theme.css" rel="stylesheet" />
    <script src="Jquery/alert.js"></script>

 <script language="javascript">
                function ConfirmRemoveDialog() {
                    //If validation failed    
                    $.alert.open('confirm', 'Lorem ipsum dolor sit amet');
                    return false;

                    //If validation passed in that case return true.
                }
    </script>

 <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick ="return ConfirmRemoveDialog();" />


You can also call from code behind

  protected void Button1_Click(object sender, EventArgs e)
    {
        ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage","ConfirmRemoveDialog();", true);
    }