access static variable from aspx page
<pre><code> public partial class Page1 :System.Web.UI.Page
 {
      public static LGDP.LDGPSession var1 = null;

      private void Login(this, EventArgs e)
      {
           var1 = new LGDPSession(this, data, data);
      }

      public bool IsLoggedIn()
      {
           bool login = false;

           if (var1 != null)
           {
                login = true;
           }

           return var1;
      }
 }
</code></pre>

<p>How do I access the Page1 static var1 or function IsLoggedIn() from Page2.apsx ?</p>

<pre><code> public partial class Page2 :System.Web.UI.Page
 {
      Page1.(nothing shows up here)
 }
</code></pre>

<p>ANSWER ----- created separate class and accessed public var in pageload / postback</p>

<pre><code>private static bool _login = false;

public static void SetLoggedIn(object lgdps)
{
    if (lgdps == null)
    {
        _login = false;
    }

    if (lgdps != null)
    {
        _login = true;
    }
}

public static bool IsLogin
{
    get { return _login; }
}
</code></pre>
