show exception error message in view
<p>I'm trying to get exception message like this and pass to <code>FileUpload</code> view like this in controller class</p>

<pre><code>        catch (Exception ex)
        {
            ViewBag.Error = ex.Message;                
        }

        return RedirectToAction("FileUpload", "FileUpload",ViewBag.Error);
    }
</code></pre>

<p>In <code>FileUpload</code> view page I'm trying to show that error messge like this</p>

<pre><code>@ViewBag.Error
</code></pre>

<p>But I cannot see any error message here</p>

<p><strong>EDIT</strong></p>

<pre><code>    [HttpGet]
    public ActionResult FileUpload()
    {
       ..
       return View(p);
    }

    [HttpPost]
    public ActionResult FileUpload(HttpPostedFileBase file)
    {
        ..
        return RedirectToAction("FileUpload", "FileUpload");
    }
</code></pre>