How to set ASP.NET session variable?
<p>I am new to ASP.NET and I am trying to set session variable. I have one form (SelectPlayer.aspx) where I am trying to set the session but when I try to see the result on second page it does not show me any value. Below is my code.</p>

<p>SelectPlayer.aspx</p>

<pre><code>public partial class SelectPlayer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["player1"] == null)
        {   
            lblSelectPlayer.Text = "Select Player 1";
        }
    }

    protected void btnSelect_Click(object sender, EventArgs e)
    {            
        Session["player1"] = "PlayerSession";                
        Response.Redirect("Score.aspx");          
    }

}    
</code></pre>

<p>Score.aspx </p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["player1"] == null)
        {
            Response.Redirect("SelectPlayer.aspx");
        }  
    }
</code></pre>