MVC5 Classic
Create an Alert Dialog

The wijdialog widget allows you to easily create Modal Alert windows. See the Dialog  > Alert Dialog sample of the Control Explorer live demo at http://demo.componentone.com/ASPNET/MVCExplorer/dialog/ModalAlert .

  1. Create an C1 ASP.NET MVC 5 Web Application.
  2. In the Solution Explorer, expand the Views | Shared folder and double-click _Layout.cshtml to open the file.
  3. Add the following markup within the <body> tags of the page.
    <div>
            <div id="dialog-message" title="Download complete">
                <p>
                    <span class="ui-icon ui-icon-circle-check"></span>Your files have uploaded successfully!
                </p>
            </div>
        </div>
    
  4. Insert the following script to initialize the widget:
    <script id="scriptInit" type="text/javascript">
            $(document).ready(function () {
                /$(":wijmo-wijdialog").wijdialog("destroy").remove();
                $("#dialog-message").wijdialog({
                    autoOpen: true,
                    height: 180,
                    width: 400,
                    modal: true,
                    buttons: {
                        Ok: function () {
                            $(this).wijdialog("close");
                        }
                    },
                    captionButtons: {
                        pin: { visible: false },
                        refresh: { visible: false },
                        toggle: { visible: false },
                        minimize: { visible: false },
                        maximize: { visible: false }
                    }
                });
            });
        </script>
    
  5. Run your application to see the Alert Window. You can customize the alert by changing the text between the <p></p> tags. Your Alert Window should resemble the following image:

     

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback