Author: vipulmistry | Posted on: 10/6/2010 5:07:48 AM | Views : 426

hello frnds
i am developing a website in asp.net
i have created a class "Utility" in App_Code Folder
this class contains a static object of another class(LoginInfo) as described below:

public class Utility { public static LoginInfo CurrentUser = new LoginInfo(); }

This LoginInfo Class is my business object which only contains 2 properties UserID and UserName
Now what i am doing on my login page, after user authentication i am setting these properties with current logged in UserId and UserName

protected void Login_Click(object sender, EventArgs e) { if (Authenticated User) { Utility.CurrentUser.UserID = "001"; //ID of current logged in user Utility.CurrentUser.UserName = "Admin" //Username of current logged in user; } }
I am usi ...

Go to the complete details ...