title: How to pass ModelErrors along with redirect?
body: <p>ASP.NET MVC 2.0</p>
  
  <p>I'm doing Post-Redirect-Get, if I get errors on post, I need to include ModelErrors along for the ride to along -Redirect-Get route.
  I send it through 'TempData':</p>
  
  <pre><code>TempData["modelErors"] = 
      ModelState.
          Where(item =&gt; item.Value.Errors.Count &gt; 0).
          ToDictionary(
              item =&gt; item.Key, 
              item =&gt; item.Value.Errors.Select(error=&gt;error.ErrorMessage).ToList()
          );
  </code></pre>
  
  <p>And then reinsert it into a ModelState:</p>
  
  <pre><code>if (TempData.ContainsKey("modelErors")) {
      foreach (var errors in (IDictionary&lt;string,IList&lt;string&gt;&gt;) TempData["modelErors"]) {
          foreach (var error in errors.Value) {
              ModelState.AddModelError(errors.Key, error);
          }
      }
  }
  </code></pre>
  
  <p>Is there a better way?</p>