access resource in js c# code example
Example 1: c# access session in class
public class MySession
{
private MySession()
{
Property1 = "default value";
}
public static MySession Current
{
get
{
MySession session =
(MySession)HttpContext.Current.Session["__MySession__"];
if (session == null)
{
session = new MySession();
HttpContext.Current.Session["__MySession__"] = session;
}
return session;
}
}
public string Property1 { get; set; }
public DateTime MyDate { get; set; }
public int LoginId { get; set; }
}
Example 2: angular access current scope from console
angular.element($0).scope()