Example #1
0
        /// <summary>
        /// Shows the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="alertType">Type of the message.</param>
        public void Show(string message, ModalAlertType alertType)
        {
            //string script = "bootbox.alert('" + message + "');";
            string script = string.Format("bootbox.alert('<h4>{0}</h4>{1}');", alertType.ConvertToString(), message.EscapeQuotes());

            ScriptManager.RegisterStartupScript(this, this.GetType(), ScriptKey, script, true);
        }
        /// <summary>
        /// Show an alert message that requires user acknowledgement to continue.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="alertType"></param>
        private void ShowAlert(string message, ModalAlertType alertType)
        {
            if (this.ModalAlertControl == null)
            {
                throw new Exception("ModalAlertControl property is not initialized.");
            }

            ModalAlertControl.Show(message, alertType);
        }
Example #3
0
        /// <summary>
        /// Shows the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="alertType">Type of the message.</param>
        public void Show(string message, ModalAlertType alertType)
        {
            var    cleanMessage = message.SanitizeHtml(false).Replace("'", "&#39;");
            string script;

            if (alertType == ModalAlertType.None)
            {
                script = $"bootbox.alert('{cleanMessage}');";
            }
            else
            {
                script = $"bootbox.alert('<h4>{alertType.ConvertToString()}</h4>{cleanMessage}');";
            }

            ScriptManager.RegisterStartupScript(this, this.GetType(), ScriptKey, script, true);
        }
Example #4
0
 /// <summary>
 /// Show an alert message that requires user acknowledgement to continue.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="alertType"></param>
 private void ShowAlert(string message, ModalAlertType alertType)
 {
     ModalAlertControl.Show(message, alertType);
 }
Example #5
0
 /// <summary>
 /// Shows the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="alertType">Type of the message.</param>
 public void Show( string message, ModalAlertType alertType )
 {
     //string script = "bootbox.alert('" + message + "');";
     string script = string.Format( "bootbox.alert('<h4>{0}</h4>{1}');", alertType.ConvertToString(), message );
     ScriptManager.RegisterStartupScript( this, this.GetType(), ScriptKey, script, true );
 }