title: C# Session doesn't increment on page load
body: <p>So I have a</p>
  
  <p><code>&lt;asp:label ... &gt;</code></p>
  
  <p>That I want to hide AFTER the user has visited 3 pages on our website. So I used page_load on the master.cs page to create a session</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              createSession();
              pageCounter.Text = Session["PagesViewed"].ToString();
              return;
          }
          Session["PagesViewed"] = ((int)Session["PagesViewed"] + 1);
          pageCounter.Text = Session["PagesViewed"].ToString();
      }
      protected void createSession()
      {
          Session["PagesViewed"] = 0;
      }
  </code></pre>
  
  <p>This code compiles and to test it out, I set a label to be the counter so I could see it working. Problem is, it comes out to 0 every time. It doesn't increment. I am not sure where my error is. </p>