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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -