vellaima Posted February 10, 2003 Posted February 10, 2003 Is there anyway of storing a value which is available thro' out the forms in VB.NET. Quote
*Gurus* divil Posted February 10, 2003 *Gurus* Posted February 10, 2003 Yes, declare it at the form level rather than at the procedure level. Look up variable scope in the help files. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
wayko Posted February 10, 2003 Posted February 10, 2003 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") Quote
Moderators Robby Posted February 10, 2003 Moderators Posted February 10, 2003 wayko, I think he ment Windows Forms. (not sure) Quote Visit...Bassic Software
vellaima Posted February 11, 2003 Author Posted February 11, 2003 Can we implement SessionState in Window Form. Please do help me. Quote
*Gurus* divil Posted February 11, 2003 *Gurus* Posted February 11, 2003 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? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Moderators Robby Posted February 11, 2003 Moderators Posted February 11, 2003 No you can't. Quote Visit...Bassic Software
vellaima Posted February 11, 2003 Author Posted February 11, 2003 When the user logs into an application i would like to maintain his user_id thro' out the Window forms . Quote
Leaders quwiltw Posted February 11, 2003 Leaders Posted February 11, 2003 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? Quote --tim
Moderators Robby Posted February 11, 2003 Moderators Posted February 11, 2003 In this case I would just use a Public Property to Get/Set the UserID. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.