Storing a Value

Yes, declare it at the form level rather than at the procedure level. Look up variable scope in the help files.
 
use a session state
the session state would look like this
Session("Name") = TextBox1.Text

then the other pages you would import the class

Imports SessionStates.WebForm1
SessionStates is the project
WebForm1 is the class

then you will call the session
Label2.Text = "Hello " & Session("Name")
 
A Session is an ASP thing. If you want to persist data across forms, you can do so with variables, as I said.

If you don't understand this, can you give us a broader understanding of what you're trying to do?
 
When the user logs into an application i would like to maintain his user_id thro' out the Window forms .
 
We do this with our own custom SessionToken object that we use to pass between forms and tiers. I suppose if you had some assembly that all your tiers reference, like a SystemFramework, you might be able to get away with it being all public shared properties of an object in that assembly.

I think you guys likely know what he's getting at. How do you maintain your session data across forms and tiers?
 
Back
Top