title: Add "permission" property to ASP.NET page
body: <p>I have a ASP.NET web application with 3 types of users: user, member, admin.</p>
  
  <p>Now I'd like to create a method for every page with which I can check the user for his type and if he is not allowed to access this page, the user should be redirected to the home page.</p>
  
  <p>Currently I have this kind of code in Page_Load of every page:</p>
  
  <pre><code>if (Session["userID"] != null)
          {
              User user = userDALC.Read(Convert.ToInt32(Session["userID"]));
  
              if (user.Type == 1)
              {
                  Response.Redirect("~/Home.aspx");
              }
          }
          else
          {
              Response.Redirect("~/Home.aspx");
          }
  </code></pre>
  
  <p>This page is only visible to Members and Admins (2,3), if a user (1) wants to access this page, he will get redirected.</p>
  
  <p>So, it's obvious that this code is absolutely not suitable for my use, because it repeats very often. (on every page) </p>
  
  <p>Now, my idea was to add a property "permission" to each page, where I can set which user types are allowed to access the page.
  And I also need a method which checks this permission property on every page.</p>
  
  <p>Any ideas, how I can add such a property and any ideas where I can add this method? (maybe Masterpage?)</p>