title: TempData Message in different tab
body: <p>i want in my page after an action like RegisterUser give a message to client for result.so i use TempData(becase i use RedirectToAction method i cant use viewbag).my problem is that if user open another tab in same time message will show in another tab(any page it can be).how can i solve that??</p>
  
  <pre><code>  @using (@Html.BeginForm("RegisterUser", "UserManagement", FormMethod.Post))
  {
      @Html.AntiForgeryToken()
     @Html.Partial("_RegisterPagesMessage")
      &lt;table class="Registertbl"&gt;
          &lt;tr&gt;
              &lt;td&gt;نام*&lt;/td&gt;
              &lt;td&gt; @Html.TextBoxFor(m =&gt; m.FName, new { maxlength = 20})&lt;br /&gt;
              &lt;/td&gt;               
              &lt;td&gt;سمت*&lt;/td&gt;
              &lt;td&gt;@Html.TextBoxFor(m =&gt; m.Post, new { maxlength = 200})&lt;/td&gt;                
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;br /&gt;
          &lt;input type="submit" value="Insert" class="insertBtn" /&gt;
          @Html.ActionLink("back", "ViewUserList", "UserManagement")
  }
  </code></pre>
  
  <p>//_RegisterPagesMessage</p>
  
  <pre><code>@if (TempData["MessageResult"] == null)
  {
      &lt;div id="ErrorContent" class="msg-Red" style="display: none;"&gt;&lt;/div&gt;  &lt;br /&gt;                  
  }
  else
  {
      &lt;div id="ErrorContent"  class="@TempData["cssClass"]"  &gt;
              @Html.Label(TempData["MessageResult"] as string)
      &lt;/div&gt;  &lt;br /&gt;   
  }
  </code></pre>
  
  <p>//Controller</p>
  
  <pre><code> [HttpGet]
      public ActionResult RegisterUser()
      {
          return View(new User());
      }
      [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult RegisterUser(Common.UsersManagement.Entities.User model)
      {
          SetUserManagement();
          var Result = userManagement.RegisterUser(model);
  SetMessage(Result.Mode.ToString());
          if (Result.Mode == Common.Extensions.ActionResultMode.Successfully)
          {
                  return RedirectToAction("RegisterUser");
          }
           // if not Successfull
          return View(model);
      }    
    protected void SetMessage(string Mode)
          {
              var messageResult = XmlReader.FindMessagekey(Mode);
              TempData["MessageResult"] = messageResult.MessageContent;
              TempData["cssClass"] = messageResult.cssClass;
          }
  </code></pre>