Sunday, May 3, 2015

Show Error Message using JQuery Dialog

function ShowErrorMessage(message, title, RedirectURL, PageRebind) {
    ///<summary>
    ///function used to Show Messages
    ///</summary>

    if (!title)
        title = errorTitle;
    $(".error").html("");
    $(".error").html(message);
    if (RedirectURL) {
        $(".error").dialog({
            resizable: false,
            title: title,
            buttons: {
                OK: function (e) {
                    window.location = RedirectURL;
                }
            },
            beforeClose: function (event, ui) { window.location = RedirectURL; },
            modal: true,
            open: function (event, ui) {
                $(this).parent().appendTo("#popupHolder");
            }
        });
    }
    else {
        $(".error").dialog({
            resizable: false,
            title: title,
            modal: true,
            open: function (event, ui) {
                $(this).parent().appendTo("#popupHolder");
            },
            close: function (event) {
                if (typeof AfterMessageClose == "function" && PageRebind == true) {
                    AfterMessageClose();
                }
            }
        });
    }
    return false;
}

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...