Variable Scope

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

With the code below, is it possible to access "strTemp" in
"WebUserControl.ascx"? I always receive the error that "strTemp" is
not available. As a workaround, I am using a Session variable, but I
really don't want to.



Default.aspx
 
I am not sure but i think session variable is the best way. Cuz variables set
back to nothing everytime u load page.
 
John,

A Session variable or a hidden form field is the way to go. In your
situation with server side code, a Session varibale seems to be the best
way.
 
Back
Top