title: Remove TempData value when press Back in browser asp.net mvc 3
body: <p>I have a little issue with MVC application.</p>
  
  <p>I have an action which save information in database like:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Save()
  {
     // do something to save
     // save message in TempData
     TempData["Message"] = "Message";
  
     return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>I show an alert message which shows if an item was saved or not. I'm doing in two steps.</p>
  
  <ol>
  <li><p>in Site.Master</p>
  
  <pre><code>&lt;div id="message"&gt;&lt;%=(TempData["Message"] as string)%&gt;&lt;/div&gt;
  </code></pre></li>
  <li><p>in javascript</p>
  
  <pre><code>if($("#message").text().length)
  {  
     alert $("#message").text(); 
  }
  </code></pre></li>
  </ol>
  
  <p>After saving item, I will be redirected to <code>Index</code> page and will display the alert box. That's fine.</p>
  
  <p>The problem is the following: If I save item and redirected to <code>Index</code> and after that I press <code>backspace</code> key or click on <code>Back</code> button of browser, the alert still is shown. </p>
  
  <p>What have I to do to destroy <code>TempData</code> value when going back using either backspace key or Back button of browser ? I don't want to display alert anymore in this case.</p>
  
  <p>Thanks</p>