Sunday, April 1, 2012

Display Alert msg and method......

 public static void Show(string message)
    {
        // Cleans the message to allow single quotation marks
        string cleanMessage = message.Replace("'", "\\'");
        string script = "<script type=\"text/javascript\">alert('" + cleanMessage + "');window.location='UserSearch.aspx';</script>";

        // Gets the executing web page
        Page page = HttpContext.Current.CurrentHandler as Page;

        // Checks if the handler is a Page and that the script isn't allready on the Page
        if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
        {
            page.ClientScript.RegisterClientScriptBlock(typeof(UserManagement_Controls_ctrl_UserCreate), "alert", script);
           
        }
    }



 UserManagement_Controls_ctrl_UserCreate.Show(error.gridlablerError());

No comments:

Post a Comment