Foros del Web » Programando para Internet » ASP Clásico »

Pasar data recivida en una pagina asp como parametro de entrada para una funcion VB

Estas en el tema de Pasar data recivida en una pagina asp como parametro de entrada para una funcion VB en el foro de ASP Clásico en Foros del Web. Holo me podrian ayudar, Como puedo pasar data recivida en una pagina asp como parametro de entrada para una funcion VB En el codigo abajo, ...
  #1 (permalink)  
Antiguo 20/08/2004, 06:16
 
Fecha de Ingreso: marzo-2004
Mensajes: 77
Antigüedad: 20 años, 3 meses
Puntos: 0
Pasar data recivida en una pagina asp como parametro de entrada para una funcion VB

Holo me podrian ayudar,
Como puedo pasar data recivida en una pagina asp como parametro de entrada para una funcion VB
En el codigo abajo, la pagina recive como parametro f_usertype1 y deseo que ese valor sea pasado en el SUB Logout(a una variable como f_usertype) para que luego de acuerdo a el se redireccione y si es posible se redireccione con parametros.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<%
Option Explicit
Response.ExpiresAbsolute=#May 31,1990 13:30:15#
Response.Buffer = true
%>
<%@Language=VBScript%>
<html>
<head>
<title>AZB</title>
<%Dim usertype u
usertype=request.querystring("f_usertype1")
%>

<SCRIPT LANGUAGE=VBScript>
Dim timer,f_usertype
Sub Init()
// Set up the timer. Set it for 15 seconds
timer = window.setInterval("Logout", 2000)
End Sub

Sub Logout()
// Take whatever action is required at this point
f_usertype="1"


MsgBox f_usertype



if f_usertype="1" then window.location = "http://www.seznam.cz"
if f_usertype="2" then window.location = "http://www.google.com"
if f_usertype="3" then window.location = "http://www.iol.cz"
if f_usertype="4" then window.location = "http://www.email.cz"

End Sub

Sub Delay()
// Delay the logout
clearInterval(timer)
Init
End Sub
</SCRIPT>
</head>
<body onload="Init">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><table width="100%" height="450" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="4">&nbsp;</td>
<td width="516" height="54"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="181"><!--WTD_A(Logo)-->&nbsp;</td>
<td style="BORDER-BOTTOM: #CCCCCC 1px solid" align="center"><!--WTD_A(Book)--></td>
</tr>
</table></td>
<td style="BORDER-BOTTOM: #CCCCCC 1px solid" width="260" height="54"><!--WTD_A(Menu_Up)-->&nbsp;</td>
<td rowspan="4">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="180"><!--WTD_A(PodSekce_Pic)--></td>
<td width="596" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td ><!--WTD_A(Menu_middle)--></td>
</tr>
<tr>
<td align="left">
<table width="596" cellpadding="5">
<TR>
<td bgcolor="#FFCC33"><!--WTD_A(Text_Up)--></td>
</TR>
</table>
</td>
</tr>
<tr>
<td height="21"><!--WTD_A(Podsekce)-->&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="BORDER-TOP: #CCCCCC 1px solid" width="776" height="21" colspan="2" align="center" valign="top"><!--WTD_A(menu_down)-->&nbsp;</td>
</tr>
<tr>
<td width="776" height="21" colspan="2" align="center" valign="top"><!--WTD_A(Copyright)-->&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
  #2 (permalink)  
Antiguo 20/08/2004, 06:44
Avatar de PMP
PMP
 
Fecha de Ingreso: febrero-2003
Ubicación: Chacabuco - Buenos Aires
Mensajes: 214
Antigüedad: 21 años, 3 meses
Puntos: 1
Hola:
Haber si entendí lo que pedís...
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<% 
Option Explicit
Response.ExpiresAbsolute=#May 31,1990 13:30:15#
Response.Buffer = true
%>
<%@Language=VBScript%>
<html>
<head>
<title>AZB</title>
<%Dim usertype u
usertype=request.querystring("f_usertype1")
%>

<SCRIPT LANGUAGE=VBScript>
Dim timer,f_usertype
Sub Init()
// Set up the timer. Set it for 15 seconds
timer = window.setInterval("Logout", 2000)
End Sub

Sub Logout()
// Take whatever action is required at this point
f_usertype = <%=usertype%>


MsgBox f_usertype



if f_usertype="1" then window.location = "http://www.seznam.cz"
if f_usertype="2" then window.location = "http://www.google.com"
if f_usertype="3" then window.location = "http://www.iol.cz"
if f_usertype="4" then window.location = "http://www.email.cz"

End Sub

Sub Delay()
// Delay the logout
clearInterval(timer)
Init
End Sub
</SCRIPT>
</head>
  #3 (permalink)  
Antiguo 20/08/2004, 08:16
 
Fecha de Ingreso: marzo-2004
Mensajes: 77
Antigüedad: 20 años, 3 meses
Puntos: 0
Hola, ya habia probado lo que me dices,

f_usertype = <%=usertype%>

pero me sale error, la verdad nose porque, me parece que no lee bien el parametro pasado

usertype=request.querystring("f_usertype1")

Cuando le asigno directamete un valor a usertype, todo funciona bien, pero ese no el proposito.
a esta pa
gina la llamo asi:

http://root/pages/After_Registrace_Sablona.asp?f_usertype1="1"

Alguna otra idea?
Gracias
  #4 (permalink)  
Antiguo 20/08/2004, 09:09
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 4 meses
Puntos: 146
Intenta con http://root/pages/After_Registrace_S...?f_usertype1=1, ya que f_usertype = <%=usertype%> lo recibe como string. Aunque eso es indistinto, en VBScript todas las variables son variant a menos que indiques lo contrario mediante castings.
  #5 (permalink)  
Antiguo 20/08/2004, 09:52
 
Fecha de Ingreso: marzo-2004
Mensajes: 77
Antigüedad: 20 años, 3 meses
Puntos: 0
gracias por la respuesta, pero igual, error
  #6 (permalink)  
Antiguo 20/08/2004, 10:35
Avatar de Myakire
Colaborador
 
Fecha de Ingreso: enero-2002
Ubicación: Centro de la república
Mensajes: 8.849
Antigüedad: 22 años, 4 meses
Puntos: 146
¿Qué error marca (sino sale el error, modifica Opciones de Internet -> Opciones Avanzadas -> Desmarcar "Mostrar mensajes descriptivos)?
¿Haz verificado que Request.QueryString llega con algo?
  #7 (permalink)  
Antiguo 24/08/2004, 12:59
Avatar de PMP
PMP
 
Fecha de Ingreso: febrero-2003
Ubicación: Chacabuco - Buenos Aires
Mensajes: 214
Antigüedad: 21 años, 3 meses
Puntos: 1
Donde dice:

Dim usertype u

La 'u' al final te va a generar error.
Debes poner

Dim usertype
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:53.