title: Sending data to my master page
body: <p>I'm working on an intranet (correcting bugs and adding features) - but there's an issue with the display of the administrator tab, it display either way !</p>
  
  <p>I am now able to know if the Employee is an administrator or not with the following SQL request :</p>
  
  <pre><code>[HttpPost]
  [AllowAnonymous]
  [ValidateAntiForgeryToken]
  public ActionResult Login(LoginModel model, string returnUrl)
  {
      // Variables
      string isAdministrator;
      bool isAdmin;
  
      // Checks the admin status of logging in user
      using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
      {
          using (SqlCommand command = new SqlCommand("SELECT isAdministrator FROM Employee WHERE Login = '" + model.UserName + "'", connection))
          {
              connection.Open();
              using (SqlDataReader reader = command.ExecuteReader())
              {
                  while (reader.Read())
                  {
                      isAdministrator = reader[0].ToString();
                      isAdmin = Convert.ToBoolean(isAdministrator);
                      ViewData["isAdmin"] = isAdmin;
                  }   
              }            
           }
       }            
  
  
        // Not relevant things related to logging in
    return View(model);
  }
  </code></pre>
  
  <p>The behavior should be : if <code>isAdmin</code> is true, display Administration tab (or simply deny its access) if not, don't.</p>
  
  <p>But I have two major issues :</p>
  
  <ul>
  <li><p>I wonder where I can fill my <code>isAdmin</code> variable to have it filled no matter what (so that I don't have to log in to have it filled)</p></li>
  <li><p>And I don't know how to pass it's value to my <code>Site.Master</code></p></li>
  </ul>