NetTalk Central

Author Topic: Where to set Session Value when Button is pressed  (Read 3223 times)

Alan Cochran

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Where to set Session Value when Button is pressed
« on: August 06, 2007, 09:08:27 AM »
I need to be able to set a session value when a button is pressed on a page before calling a browse.  Which embed point do I use to for me to be able to set this value? I currently have two buttons on a page that call the same NetBrowse procedure but based on a SessionValue, I need it to hide either the Change or Insert button based on the SessionValue.  I know I could just create a second NetBrowse procedure but I would like to use just this Browse procedure.

Any help is appreciated.

Thanks...
Alan
« Last Edit: August 06, 2007, 05:17:28 PM by Alan Cochran »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Where to set Session Value when Button is pressed
« Reply #1 on: August 06, 2007, 10:45:29 PM »
Hi Alan,

I think your most reliable option is to add a parameter to the URL so that the browse can take care of it. For example on one button have
'CustomersBrowse?i=1' and the other 'CustomersBrowse?i=2'

Then in the CustomersBrowse, top of GenerateBrowse routine do

  p_web.StoreValue('i')

then use p_web.GetSessionValue('i') in the conditional for the Insert & Change buttons.

cheers
Bruce

Alan Cochran

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Where to set Session Value when Button is pressed
« Reply #2 on: August 07, 2007, 04:07:42 AM »
Hi Bruce,

That worked!

Thank you...
Alan