Ajax swal message RRS feed

  • Question

  • I am having trouble to get Swal function works. I am trying to use a nice looking pop message window by using Swal bootstrap instead of alert but it didn't work. Can someone please tell me what is going on. Here is the code:

      <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
        <link href="/Content/cssnew/ie10-viewport-bug-workaround.css" rel="stylesheet">
        <link href="~/bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet" /> 
        <script src="~/bootstrap-3.3.6-dist/js/bootstrap.js"></script>  
        <script src="https://lipis.github.io/bootstrap-sweetalert/lib/sweet-alert.js"></script>
        <link href="~/Content/sweetalert/sweet-alert.css" rel="stylesheet" />  
        <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
        <link href="/Content/cssnew/font-awesome.min.css" rel="stylesheet">
        <!-- Custom styles for this template -->
        <!-- Custom styles for this template -->
        <link rel="stylesheet" href="/Content/cssnew/owl.carousel.min.css">
        <link rel="stylesheet" href="/Content/cssnew/owl.theme.default.min.css">
        <link href="/Content/cssnew/style.css" rel="stylesheet">
    $('#btnSend').click(function () {
                    $.blockUI({ message: '<p style="margin-top:8px !important; margin-bottom:8px !important;"><img src="/images/loading.gif" /> Loading...</p>' });
                        type: 'POST',
                        url: '@Url.Action("SaveContactUsDetail", "ContactUs")',
                        data: { email: $('#txtEmail').val(), Name: $('#txtName').val(), Message: $('#txtMessage').val() },
                        success: function (data) {
                            alert('We will contact you as soon as possible.');
                        error: function (ex) {
                            swal("Internal server error !");
                            // End window
                           // alert('Internal server error.');
                            //alert({ message:'<div id="dialog-message" title="Download complete"> <p> <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span> Your files have downloaded successfully into the My Downloads folder. </p> <p> Currently using <b>36% of your storage space</b>. </p> </div>' });


    • Edited by Montadar Thursday, November 29, 2018 5:23 PM
    • Moved by CoolDadTx Thursday, November 29, 2018 8:55 PM ASP.NET related
    Thursday, November 29, 2018 5:17 PM

All replies

  • JavaScript and Ajax can be discussed at the ASP.NET forums.


    Thursday, November 29, 2018 7:10 PM
  • Thank you for letting me know


    Thursday, November 29, 2018 7:23 PM