title: How to show alert message in mvc 4 controller?
body: <p>I tried show a alert box in mvc controller by if-else condition.But alert box does not display.Where is my mistake ?</p>
  
  <p>Controller</p>
  
  <pre><code>public ActionResult Index()
  {
      int userId = Convert.ToInt32(Session["userId"].ToString());
  
      if (WebMatrix.WebData.WebSecurity.IsAuthenticated)
      {
          if (userId == 90043) 
          {
              return View();
          }
          else
          {
              TempData["Message"] = "You are not authorized.";
              return RedirectToAction("Index", "Home");
          }
      }
      else
      {
          return RedirectToAction("Index", "Home");
      }
  }
  </code></pre>