Ejemplo n.º 1
0
        /// <summary>
        /// A server side display method that forces the modal dialog to be to be displayed
        /// when the page loads.
        ///
        /// Note the page still loads and when you click out of the dialog you will
        /// be back on the original page. IOW, it's still full client side behavior
        /// even though activated through the server.
        /// </summary>
        /// <param name="Message"></param>
        /// <param name="Title"></param>
        /// </summary>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="okButtonText"></param>
        /// <param name="cancelButtonText"></param>
        public void Show(string message, string title, bool asHtml)
        {
            //message = message ?? "null";
            //title = title ?? "null";

            // Hooks up window.load event handler - we'll need to load the page first
            // or IE will choke on the script execution.
            ShowScript = string.Format(
                @"$(function() {{ {0}.show({1},{2},{3}); }});
", ID, UrlUtils.EncodeJsString(message), UrlUtils.EncodeJsString(title), asHtml.ToString().ToLower());
        }