HighTechTalks DotNet Forums  

help on script to read session variable

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss help on script to read session variable in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Brian
 
Posts: n/a

Default help on script to read session variable - 12-13-2005 , 12:29 PM






Hi, All,
I write a JavaScript to read session("CheckedFlag") and to decide if i need
to give the message when user close the browser. but it don't work when read
the session variable. I'm using VB.net to write the web application. If
JavaScript won't work, will Jscript work? or is there a way to do that? I'm
new to ASP and ASP.net and here is the code snippet. it looks simple and
there should be a way to do it, but i don't find the one.

thanks for your help

<HEAD>
<script language="JavaScript" runat ="server">
var needToConfirm = true;
window.onbeforeunload = confirmExit;
var SesType ='<%= Session("CheckedFlag")%>';
function confirmExit()
{
if (SesType =="1" || SesType == '1')
{
needToConfirm = false;
}
if (needToConfirm)
return "Are you sure you want to close the browser?";
}
</script>
</HEAD>

<body onbeforeunload ="javascript:confirmExit()">
Test Form
</body>

Reply With Quote
  #2  
Old   
Brian
 
Posts: n/a

Default RE: help on script to read session variable - 12-13-2005 , 10:09 PM







never mind. I figure it out.

thanks

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.