title: Pass message on redirect to view in ASP.NET MVC
body: <p>I have an ASP.NET MVC online shop-like application with two views:</p>
  
  <ul>
  <li>An item's page (photo, description, etc.)</li>
  <li>A form where the user may leave a review</li>
  </ul>
  
  <p>After the user successfully submits the form, he should be redirected back to the item's page and a one-time message should be displayed on top: "Your review has been submitted successfully".</p>
  
  <p>The controller code (simplified) looks like this:</p>
  
  <pre><code>[HttpGet]
  public ActionResult ViewItem([Bind] long id)
  {
      var item = _context.Items.First(x =&gt; x.Id == id);
      return View(item);
  }
  
  [HttpGet]
  public ActionResult AddReview()
  {
      return View();
  }
  
  [HttpPost]
  public ActionResult AddReview([Bind] long id, [Bind] string text)
  {
      _context.Reviews.Add(new Review { Id = id, Text = text });
      _context.SaveChanges();
  
      return RedirectToAction("ViewItem");
  }
  </code></pre>
  
  <p>There are a few requirements to meet:</p>
  
  <ul>
  <li>The message must not show again if the user refreshes the item's page.</li>
  <li>The message must not pollute the URL.</li>
  <li>The controller methods may not be merged into one.</li>
  </ul>
  
  <p>I was thinking of storing the message in user session and discarding it once displayed, but may be there's a better solution?</p>