c# - Use object in multiple forms -
currently i'm making asp.net webapplication. i've login form make object user. how can access object in form?
please see code:
login form
users user = new users(username, password); user.receiveuserinformation();
form userpage
this want acces object "user". what's right way this. thought this:
users user = new users(username, password); user.receiveuserinformation(); session["new"] = user;
and then:
session["new"].receiveuserinformation();
but doesn't work.
it work using session : cast users class
users newuser = (users) session["new"];
Comments
Post a Comment