Bienvenido(a) Visitante | RSS
Mi sitio
Inicio » 2012 » Noviembre » 30 » carga ventana pop-up visual .net
9:05 PM
carga ventana pop-up visual .net
Public Function CargaScriptPopUp(ByVal sPagDestino As String, ByVal sVentanaPopUp As String, ByVal sPage As Page) As String Dim sJava As String sJava = "function JavaPopUp(ssLargo,ssAncho,WinWidth,WinHeight,txtCve,txtDes) " & Chr(13) & _ " { " & Chr(13) & _ " var str2 = ''; " & Chr(13) & _ " var str1 = ''; " & Chr(13) & _ " var Argumentos = new Array(str1, str2); " & Chr(13) & _ " var ran =Math.random()*4; //usamos esto para asegurarnos que la pagina destino se refresque " & Chr(13) & _ " var ConfiguracionPagina=''; " & Chr(13) & _ " var targetY = document.body.scrollTop+window.event.clientY ; " & Chr(13) & _ " var targetX = document.body.scrollLeft + window.event.clientX ; " & Chr(13) & _ " var Pagina = " & Chr(34) & "" & sVentanaPopUp & "?rn= " & Chr(34) & "+ ran; " & Chr(13) & _ " var xxLeft " & Chr(13) & _ " var xxTop " & Chr(13) & _ " var v_LargoDatos " & Chr(13) & _ " var v_AnchoDatos " & Chr(13) & _ " var sLargo " & Chr(13) & _ " var sAncho " & Chr(13) & _ " // var ssLargo " & Chr(13) & _ " // var ssAncho " & Chr(13) & _ " if (ssLargo>0 && ssAncho>0) " & Chr(13) & _ " { " & Chr(13) & _ " xxLeft = targetX; " & Chr(13) & _ " if (WinWidth>=1024) " & Chr(13) & _ " { xxTop = targetY+110;} " & Chr(13) & _ " else " & Chr(13) & _ " { xxTop = targetY;} " & Chr(13) & _ " v_LargoDatos = ssLargo; " & Chr(13) & _ " v_AnchoDatos = ssAncho; " & Chr(13) & _ " //-> area disponible para desplegar la ventana " & Chr(13) & _ " sLargo = WinWidth - xxLeft; " & Chr(13) & _ " sAncho = WinHeight - xxTop; " & Chr(13) & _ " if (sLargo < 0) { sAncho = sAncho * -1; } " & Chr(13) & _ " if (sLargo < 0) { sLargo = sLargo * -1; } " & Chr(13) & _ " if (sLargo >= v_LargoDatos && sAncho >= v_AnchoDatos) " & Chr(13) & _ " { " & Chr(13) & _ " xTop = xxTop ; " & Chr(13) & _ " xLeft = xxLeft; " & Chr(13) & _ " } " & Chr(13) & _ " else " & Chr(13) & _ " { " & Chr(13) & _ " if (sLargo < v_LargoDatos && sAncho >= v_AnchoDatos) " & Chr(13) & _ " { " & Chr(13) & _ " sLargo = xxLeft - v_LargoDatos " & Chr(13) & _ " if (sLargo < 0) { sLargo = sLargo * -1; } " & Chr(13) & _ " xTop = xxTop; " & Chr(13) & _ " xLeft = sLargo; " & Chr(13) & _ " } " & Chr(13) & _ " else " & Chr(13) & _ " { " & Chr(13) & _ " if (sLargo < v_LargoDatos && sAncho < v_AnchoDatos) " & Chr(13) & _ " { " & Chr(13) & _ " sLargo = xxLeft - v_LargoDatos " & Chr(13) & _ " sAncho = xxTop - v_AnchoDatos " & Chr(13) & _ " if (sLargo < 0) { sLargo = sLargo * -1; } " & Chr(13) & _ " if (sAncho < 0) { sAncho = sAncho * -1; } " & Chr(13) & _ " xTop = sAncho; " & Chr(13) & _ " xLeft = sLargo; " & Chr(13) & _ " } " & Chr(13) & _ " else " & Chr(13) & _ " { " & Chr(13) & _ " if (sLargo >= v_LargoDatos && sAncho < v_AnchoDatos) " & Chr(13) & _ " { " & Chr(13) & _ " sAncho = xxTop - v_AnchoDatos " & Chr(13) & _ " if (sAncho < 0) { sAncho = sAncho * -1; } " & Chr(13) & _ " xTop = sAncho; " & Chr(13) & _ " xLeft = xxLeft; " & Chr(13) & _ " }}}} " & Chr(13) & _ " ConfiguracionPagina= " & Chr(34) & "center:yes;resizable:no;help:no;status:no " & Chr(34) & " " & Chr(13) & _ " ConfiguracionPagina=ConfiguracionPagina + " & Chr(34) & ";dialogTop: " & Chr(34) & " + xTop + " & Chr(34) & " px " & Chr(34) & " " & Chr(13) & _ " ConfiguracionPagina=ConfiguracionPagina + " & Chr(34) & ";dialogLeft: " & Chr(34) & " + xLeft + " & Chr(34) & " px " & Chr(34) & " " & Chr(13) & _ " ConfiguracionPagina=ConfiguracionPagina + " & Chr(34) & ";dialogWidth: " & Chr(34) & " + ssLargo + " & Chr(34) & " px " & Chr(34) & " " & Chr(13) & _ " ConfiguracionPagina=ConfiguracionPagina + " & Chr(34) & ";dialogHeight: " & Chr(34) & " + ssAncho + " & Chr(34) & " px " & Chr(34) & " " & Chr(13) & _ " Argumentos = window.showModalDialog (Pagina, Argumentos, ConfiguracionPagina); " & Chr(13) & _ " if(Argumentos == null) " & Chr(13) & _ " { // mandamos un mensaje " & Chr(13) & _ " } " & Chr(13) & _ " else " & Chr(13) & _ " { //quiere decir que se ha devuelto una lista de contactos " & Chr(13) & _ " // window.alert(NameControl); " & Chr(13) & _ " document.getElementById(txtCve).value = Argumentos[0]; " & Chr(13) & _ " document.getElementById(txtDes).value = Argumentos[1]; " & Chr(13) & _ " } " & Chr(13) & _ " } " & Chr(13) & _ "} " CargaScriptPopUp = sJava Sis_RegCodJava(sJava, sPagDestino, sPage) End Function Public Sub Sis_RegCodJava(ByVal sCodScript As String, ByVal sPagDestino As String, ByVal sPage As Page) '--> Ejecuta un string que contiene codigo javaScript Dim sCodJavaScript As String
sCodJavaScript = "<meta content=" & Chr(34) & "JavaScript"
& Chr(34) & " name=" & Chr(34) &
"vs_defaultClientScript" & Chr(34) & "> " & Chr(13)
sCodJavaScript = sCodJavaScript & " <script language=" &
Chr(34) & "javascript" & Chr(34) & "> " & Chr(13) sCodJavaScript = sCodJavaScript & sCodScript & Chr(13) sCodJavaScript = sCodJavaScript & "</script> " & Chr(13) 'sPage.RegisterClientScriptBlock(sPagDestino, sCodJavaScript) sPage.ClientScript.RegisterStartupScript(sPage.GetType(), sPagDestino, sCodJavaScript) End Sub
Vistas: 392 |
Agregado por: miket
| Valoración: 0.0 /0
Martes, 11.26.2024, 5:17 AM
Menú del sitio
Formulario de entrada
Búsqueda
Archivo de registros
Estadística
Total en línea: 1
Invitados: 1
Usuarios: 0
Calendario