Opcion de no cerrar alert
This commit is contained in:
@@ -5276,14 +5276,14 @@ Public Class ClsPaginas
|
||||
|
||||
Usuario.CerrarSession()
|
||||
End Sub
|
||||
Public Sub Alert(Mensaje As String, Optional pOpcion As TipoMensaje = TipoMensaje.MsgInformacion, Optional JSBtnAceptar As String = "", Optional timeout As Integer = 5)
|
||||
Public Sub Alert(Mensaje As String, Optional pOpcion As TipoMensaje = TipoMensaje.MsgInformacion, Optional JSBtnAceptar As String = "", Optional timeout As Integer = 5, Optional ShowCloseButton As Boolean = True)
|
||||
If DirectCast(pOpcion, Integer) >= 5 Then
|
||||
Mensaje = Mensaje.Replace("'"c, "\'").Replace(vbCrLf, "").Replace("""", "\'").Replace(vbLf, " ")
|
||||
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
|
||||
Dim toastscript As String = String.Format("alertatoast({3},'{0}',function(){{{1}}},{2});", Mensaje, JSBtnAceptar, timeout, DirectCast(pOpcion, Integer))
|
||||
ViewState("strToastMsglargonoreplace") = String.Format("{0}{1}", If(Not IsNothing(ViewState("strToastMsglargonoreplace")) AndAlso ViewState("strToastMsglargonoreplace").ToString().Length > 0, ViewState("strToastMsglargonoreplace").ToString(), ""), toastscript)
|
||||
Else
|
||||
Mensaje.Alert(Mensaje, pOpcion, JSBtnAceptar, TimeoutToast:=timeout)
|
||||
Mensaje.Alert(Mensaje, pOpcion, JSBtnAceptar, TimeoutToast:=timeout, ShowCloseButton:=ShowCloseButton)
|
||||
End If
|
||||
End Sub
|
||||
Protected Overridable Sub Page_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender
|
||||
|
||||
@@ -311,7 +311,7 @@ Namespace Extensiones
|
||||
ToastAdventencia = 8 'Warning
|
||||
End Enum
|
||||
<Runtime.CompilerServices.Extension()>
|
||||
Public Sub Alert(Obj As Object, Mensaje As String, pOpcion As TipoMensaje, Optional JSBtnAceptar As String = "", Optional TextoConfirmacion As String = "Aceptar", Optional TextoCancelacion As String = "Cancelar", Optional TimeoutToast As Integer = 5)
|
||||
Public Sub Alert(Obj As Object, Mensaje As String, pOpcion As TipoMensaje, Optional JSBtnAceptar As String = "", Optional TextoConfirmacion As String = "Aceptar", Optional TextoCancelacion As String = "Cancelar", Optional TimeoutToast As Integer = 5, Optional ShowCloseButton As Boolean = True)
|
||||
If System.Web.HttpContext.Current IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler IsNot Nothing AndAlso System.Web.HttpContext.Current.Handler.GetType().IsSubclassOf(GetType(Page)) Then
|
||||
|
||||
Dim Titulo As String = ""
|
||||
@@ -331,6 +331,7 @@ Namespace Extensiones
|
||||
Dim b3title As String = ""
|
||||
Dim b3clas As String = "hide"
|
||||
Dim b3js As String = ""
|
||||
Dim closeButtonOption As String = ""
|
||||
Select Case pOpcion
|
||||
Case TipoMensaje.MsgInformacion
|
||||
Titulo = "<i class='fa fa-info-circle'></i> Información"
|
||||
@@ -371,15 +372,18 @@ Namespace Extensiones
|
||||
End Select
|
||||
|
||||
Try
|
||||
|
||||
'No cerrar el alert obliga a hacer click en los botones de opcion
|
||||
If Not ShowCloseButton Then
|
||||
closeButtonOption = "backdrop : ""static"", keyboard : false, closeButton: false,"
|
||||
End If
|
||||
|
||||
Dim Pag As Page = DirectCast(System.Web.HttpContext.Current.Handler, Page)
|
||||
Dim script As String = ""
|
||||
If showalert Then
|
||||
script = String.Format("bootbox.dialog({{message: ""{0} "",className: ""{11}"",onEscape: function() {{ {12} }},title: ""{1}"",buttons: {{ success: {{ label: ""{2}"", className: "" {3}""," &
|
||||
script = String.Format("bootbox.dialog({{message: ""{0} "", className: ""{11}"", {12} onEscape: function() {{ {12} }},title: ""{1}"",buttons: {{ success: {{ label: ""{2}"", className: "" {3}""," &
|
||||
"callback: function() {{ {4} }} }}, danger: {{ label: ""{5}"", className: "" {6}"",callback: function() {{ {7} }} }}," &
|
||||
"main: {{ label: ""{8}"", className: "" {9}"", callback: function() {{ {10} }} }} }} }});",
|
||||
Mensaje, Titulo, b3title, b3clas, b3js, b2title, b2clas, b2js, b1title, b1clas, b1js, headerclas, onEscape)
|
||||
Mensaje, Titulo, b3title, b3clas, b3js, b2title, b2clas, b2js, b1title, b1clas, b1js, headerclas, onEscape, closeButtonOption)
|
||||
Else
|
||||
|
||||
script = String.Format("alertatoast({3},'{0}',function(){{{1}}},{2});", Mensaje, JSBtnAceptar, TimeoutToast, DirectCast(pOpcion, Integer))
|
||||
@@ -3592,9 +3596,9 @@ Namespace Extensiones
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "A T R I B U T O S"
|
||||
Public Class BasicAuthenticationAttribute
|
||||
Inherits AuthorizationFilterAttribute
|
||||
@@ -3660,7 +3664,7 @@ Namespace Extensiones
|
||||
actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.Unauthorized)
|
||||
actionContext.Response.Headers.Add("WWW-Authenticate", "Basic Scheme='Data' location = 'http://localhost:")
|
||||
End Sub
|
||||
End Class
|
||||
End Class
|
||||
#End Region
|
||||
|
||||
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user