Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP-Urgent

Status
Not open for further replies.

murugesanks

Programmer
Jan 25, 2001
48
US
Hi,

I need to call a funtion on Body onload. That function should set my session variable to some value.

Like..
------


function onload

session("tmpVar")=False
..


How to do it.

-Murugesan

 
You cannot. <body onload=&quot;..&quot;> is on client side. Session is on server side.
 
Not necessarily...

True, with the body onLoad, you cannot, but with server side script, you could just put the function in somewhere (anywhere), and it will execute, and set the variable. I can't think of a reason why you would HAVE to trigger the function with onLoad (I'm thinking that's probably just what you're used to doing).

Just stick this in the head of your html page:
Code:
<%session(&quot;myVarName&quot;)=false%>

Should work just fine and set your variable.

hope it helps!:)
Paul Prewett
 
there is a script function called thispage_onShow...
the function will get called when the page shows (obviously). Maybe that will help you.

the syntax is
sub thispage_onShow

end sub

Warning: I'm not totally sure if this will work, I remember this was a workaround we implemented due to Interdev DTC's, but I don't remember what happened when we took the VI DTC's out and the SOM out, but left the thisPage_onShow function in.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top