Email This Post Email This Post Print This Post Print This Post

ASP .Net Popup Windows

.Net Platform Add comments


Gran utilidad con los dialogos Modales en web:

//**************************************
//
// Nombre: ASP.NET Popup Windows
// Descripcion:Muestra una pagina como una ventana popup como dialogo modal en  ASP.NET.
//
// Como usar:’ searchButton.Attributes.Add(“onclick”, BuildPopUpScript(“PopupPage.aspx”, 800, 600))
//
//**************************************
//    

Public Function BuildPopUpScript(ByVal Page As String, _
Optional ByVal dialogWidth As Int32 = 255, _
Optional ByVal dialogHeight As Int32 = 255, _
Optional ByVal modal As Boolean = True) As String
Try
Dim
jsmodal As String
If modal Then
jsmodal &= “if (window.showModalDialog)”
jsmodal &= “{window.showModalDialog(‘” & Page.Trim & “‘,’name’,”
jsmodal &= “‘dialogWidth:” & dialogWidth & “px;dialogHeight:” & dialogHeight & “px;status:no;help:no;scroll:no’);}”

jsmodal &= “else{“
jsmodal &= “window.open(‘” & Page.Trim & “‘,’name’,'height=” & dialogHeight & “,”
jsmodal &= “width=” & dialogWidth & “,toolbar=no,directories=no,status=no,”
jsmodal &= “menubar=no,scrollbars=no,resizable=no,modal=yes’);”
jsmodal &= “}”
Else
jsmodal &= “window.open(‘” & Page.Trim & “‘,’name’,'height=” & dialogHeight & “,”
jsmodal &= “width=” & dialogWidth & “,toolbar=no,directories=no,status=no,”
jsmodal &= “menubar=no,scrollbars=no,resizable=no,modal=no’);”
  End If
Return jsmodal
Catch ex As Exception
Return “alert(” & ex.Message & “);”
End Try

End Function

Leave a Reply

Powered by WP Hashcash

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

Debes leer y teclear los 5 caracteres entre 0..9 y A..F, y enviar la respuesta.

  

No puedo leer esto. Por favor, generar un

Powered by RAGE SYSTEMS S.A.C. - Icons by N.Design Studio
Entries RSS Comments RSS Log in