NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: kingja on March 01, 2010, 10:06:55 PM

Title: display session variables on index.htm
Post by: kingja on March 01, 2010, 10:06:55 PM
     I have a web app, built using frames.  The center frame is set up to display the index.htm page.  I want to dynamically add data to this on login and logout.  Upon login, I want to display a welcome message along with the user name, which I have stored in a session variable (PatientName).  Upon logout, I want to display a thankyou message and some links to educational materials.  I realize I can use two different pages, the index for login and a nother page, such as logout.htm. 
     I have experimented with tags, such as <!--Net:s:PatientName -->, in an attempt to display the patient name.  I have created a source procedure with this tag in the XHTML section.  I then call this as <!-- Net:MySourceProc --> but have not been successful.
     Can anyone help and show me the right way to do this?

Thanks,
Title: Re: display session variables on index.htm
Post by: Rene Simons on March 02, 2010, 03:57:26 AM
Hi Kingja,
Have you set the appropiate sessionvar with the patientname AFTER the login is validated in the login procedure?

p_web.gsv('PatientName',PatientName)

The <!--Net:s:PatientName --> tag should be used in the logout procedure, before the logout button.
Like:

Welcome <!--Net:s:PatientName -->

Note that the tags are also case sensitive.

After the logout button has been used you could make an exit page

Rene
Title: Re: display session variables on index.htm
Post by: kingja on March 02, 2010, 12:53:18 PM
Rene,

     Thanks.  I have this almost working.  The session variable does display on my index.htm page, but only after doing a refresh, or opening and closing my browse/form procedures.  Is there a way to reload or refresh a page on demand?

Jeff King
Title: Re: display session variables on index.htm
Post by: Bruce on March 02, 2010, 11:13:56 PM
Hi Jeff,

Typically the way to refresh multiple panes in a frame at the same time is either to use JavaScript, or simply refresh the "FramePage" page rather than any individual page. ie make the "Save URL" for the login to be "framePage" (and set the Target to '_top' )

cheers
Bruce

Title: Re: display session variables on index.htm
Post by: kingja on March 03, 2010, 08:22:00 AM
Thanks Bruce!  This worked perfectly.  By the way, I did find another post here that used the following javascript:

<script> parent.frames.MyFrame.location.reload(); </script>

This worked well but your method is much cleaner.

Thanks again.

Jeff