Beispiel #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);
        }
Beispiel #2
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);
        }
Beispiel #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 )
 {
     //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 );
 }