Why is my app losing page variable values?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benwizzle
    New Member
    • May 2010
    • 72

    Why is my app losing page variable values?

    So to pretty much make this short and sweet, I have a page variable defined outside of all my methods and functions called buttonpressed. It is used to keep track of which button has been pressed on the app. For example, in the onclick event of my Edit button there is a line:
    Code:
    buttonpressed = "Edit"
    I use this to decide what kind of query to perform to my database. My problem is whenever I hit my save button(which uses that buttonpressed value in an if statement to decide what query to perform), the variable value just magically disappears.

    I tracked the value to make sure that it is being changed and store correctly based on my add, edit, and delete buttons. As soon as I hit my save button, the value of that variable goes blank. Any help would be appreciated because as of now im using a hidden field to store this buttonpressed value.
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Originally posted by benwizzle
    So to pretty much make this short and sweet, I have a page variable defined outside of all my methods and functions called buttonpressed. It is used to keep track of which button has been pressed on the app. For example, in the onclick event of my Edit button there is a line:
    Code:
    buttonpressed = "Edit"
    I use this to decide what kind of query to perform to my database. My problem is whenever I hit my save button(which uses that buttonpressed value in an if statement to decide what query to perform), the variable value just magically disappears.

    I tracked the value to make sure that it is being changed and store correctly based on my add, edit, and delete buttons. As soon as I hit my save button, the value of that variable goes blank. Any help would be appreciated because as of now im using a hidden field to store this buttonpressed value.
    Store the buttonPressed value in Session Variables

    Comment

    • benwizzle
      New Member
      • May 2010
      • 72

      #3
      That worked thank you :)

      Comment

      Working...