title: ASP.NET Entity Framework success message after registration
body: <p>I am really trying hard to make a popup message (success or error) when the user has finished registration. So in the <code>AccountController</code>, I made a <code>ViewBag</code> but since it redirects to <code>Login</code> right away, I've noticed that the message is not appearing or popping up. </p>
  
  <p>How do I show the message?</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Register(RegisterViewModel model)
  {
      if (ModelState.IsValid)
      {
          ....
          ViewBag.message= "Registered Successfully";
  
          return RedirectToAction("Login", "Account");
      }
  }
  </code></pre>
  
  <p><code>_Layout</code> view:</p>
  
  <pre><code>&lt;div class="container body-content"&gt;       
      @if (ViewBag.message!= null)
      {
          if (ViewBag.message.Equals("Registered Successfully"))
          {                
              &lt;div class="alert alert-success fade in"&gt;
                  &lt;a href="#" class="close" data-dismiss="alert" aria-label="close"&gt;&amp;times;&lt;/a&gt;
                  &lt;strong&gt;Success!&lt;/strong&gt; @ViewBag.message
              &lt;/div&gt;
          }
      }
      @RenderBody()              
  &lt;/div&gt;    
  </code></pre>