asked on
public class properties
{
private static HttpContext Context { get { return System.Web.HttpContext.Current; } }
private static HttpSessionState Session { get { return Context.Session; } }
// Get settings from session
public static string loggedIn { get { return (Session["Properties.loggedIn"] ?? String.Empty).ToString(); } set { Session["Properties.loggedIn"] = value; } }
public static string userId { get { return (Session["Properties.userId"] ?? String.Empty).ToString(); } set { Session["Properties.userId"] = value; } }
}
Public Class properties
Private Shared ReadOnly Property Context() As HttpContext
Get
Return System.Web.HttpContext.Current
End Get
End Property
Private Shared ReadOnly Property Session() As HttpSessionState
Get
Return Context.Session
End Get
End Property
' Get settings from session
Public Shared Property loggedIn() As String
Get
Return (If(Session("Properties.loggedIn"), String.Empty)).ToString()
End Get
Set(ByVal value As String)
Session("Properties.loggedIn") = value
End Set
End Property
Public Shared Property userId() As String
Get
Return (If(Session("Properties.userId"), String.Empty)).ToString()
End Get
Set(ByVal value As String)
Session("Properties.userId") = value
End Set
End Property
End Class
ASKER
ASKER
If properties.loggedIn = "true" Then
...
Else
...
End If
ASKER
ASKER
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
Databinding syntax in the markup.