How to assign a session value in Global page and use it in all other forms in c#
<p>I want to get the URL from Global page to a .aspx.cs page.So i want to assign the url to a session and use that session in aspx.cs page.But it is showing error that session doesn't exist in this context.I tried by declaring a public variable and  using that public variable in cs page.But i am not able to do.Here is my code:<br>
<strong>1st method:</strong><br>
   Global.asax.cs:</p>

<pre><code>        protected void Application_BeginRequest(Object sender, EventArgs e)
        {
                   Session["URL"] = Request.Url.ToString().ToLower();
        }
</code></pre>

<p>aspx.cs:</p>

<pre><code>string str = Session["URL"].ToString();
</code></pre>

<p><strong>2nd method</strong><br>
Global.asax.cs</p>

<pre><code>public class Global : System.Web.HttpApplication
    {
     public static string strurl = "";

           protected void Application_BeginRequest(Object sender, EventArgs e)
            {
                       strurl  = Request.Url.ToString().ToLower();
            }
   }
</code></pre>

<p>aspx.cs:</p>

<pre><code>string str = Global.strurl;
</code></pre>

<p>Pls help me out!!!</p>
