Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Client Side Variables


Message #1 by msayers@c... on Mon, 29 Jul 2002 00:03:49
Hi Folks,

 I have a asp page in whihc I have 3 session variables:

Session("Custid")
Session("Fname")
Session("LName")

I redirect to a clinet-side only page and want to display these three 
variables. This is how I do it (it is on the Window_onload event)
 

Sub window_onload

  dim vcust 
  dim vname  
 
  vcust = <%=Session("CustId")%>
  vlname = <%=Session("LName")%>
  vfname = <%=Session("FName")%>
  vname = vfname & vlname
  vstring = "This is the Customer that was exported: " & vname
  document.writeln(vname)
  document.writeln(vcust)
  alert(vstring)
  
End Sub
 

   It displays the custid correctly each and everytime, BUT does not 
display the vname value. I have checked to makesure that the session 
variables have values and they do contain the correct names etc.
What is going on here and how can I correct this ??
I tried to setting a session variable to the full name and it aborts when 
it hits the second page. The error is "Expecting end of Statement"
and the variable does have the full name correctly.
Any help appericated...
thanks so much :-O
  

  
Message #2 by "phil griffiths" <pgtips@m...> on Mon, 29 Jul 2002 08:48:28
Surely FName and LName are strings, so they should have " around the 
values.  Also, why have you got a JS function (alert) in the middle of 
your VBS?

HTH
Phil
> Hi Folks,

>  I have a asp page in whihc I have 3 session variables:

> Session("Custid")
S> ession("Fname")
S> ession("LName")

> I redirect to a clinet-side only page and want to display these three 
v> ariables. This is how I do it (it is on the Window_onload event)
 > 

> Sub window_onload

>   dim vcust 
 >  dim vname  
 > 
 >  vcust = <%=Session("CustId")%>
 >  vlname = <%=Session("LName")%>
 >  vfname = <%=Session("FName")%>
 >  vname = vfname & vlname
 >  vstring = "This is the Customer that was exported: " & vname
 >  document.writeln(vname)
 >  document.writeln(vcust)
 >  alert(vstring)
 >  
E> nd Sub
 > 

>    It displays the custid correctly each and everytime, BUT does not 
d> isplay the vname value. I have checked to makesure that the session 
v> ariables have values and they do contain the correct names etc.
W> hat is going on here and how can I correct this ??
I>  tried to setting a session variable to the full name and it aborts 
when 
i> t hits the second page. The error is "Expecting end of Statement"
a> nd the variable does have the full name correctly.
A> ny help appericated...
t> hanks so much :-O
 >  

  Return to Index