I usually use STATIC implementation when developing Desktop Application and I just got my head bumped on the wall when I use STATIC in ASP.NET (not a good idea)
I think I saw some feedback here before that you can use INTERFACE for passing values between Classes and Pages without using Session.
Can you guys give a good example on how to implement my question? Thanks
here’s my sample code
public interface ISessionManager
{
SessionStates sesState { get; set; }
}
public struct SessionStates
{
public string SessionID;
public bool isLoggedIn;
public string Username;
}
Use Session state objects,
Session[“variable_name”] = assign any value in one class and use this session state object in any other class.
For example,
using System.Web.SessionState;
//Store the value in the session state object in one class
Session[“sessionid”]=Request.QueryString.Get(“session_key”).ToString();
//Use the session state object in another class
String sessionid=Session[“sessionid”].ToString();