title: Redirecting to another action in same controller and passing some data asp.net mvc3
body: <p>I want to redirect to another action in same controller and pass one parameter value. I have this code:</p>
  
  <pre><code>public ActionResult Index()
  {
  
  }
  
  public ActionResult SomeAction()
  {
    if (isFailed)
    {
      // Redirect to Index Action with isFailed parameter so that some message gets displayed on Index page.
    }
   }
  </code></pre>
  
  <p>I read about using <code>TempData</code> but my session is read only (for some purpose) thus I if I save data in <code>TempData</code> in <code>SomeAction</code>, it does not help since <code>TempData</code> is empty in <code>Index</code> action.</p>
  
  <p>Another thing I tried is using <code>RedirectToAction("Index","Test", new { param = isFailed})</code> in <code>return</code> statement of <code>SomeAction</code>. This works and I can access <code>param</code> in <code>Index</code> action using <code>Request.QueryString['param']</code> but the issue with this is the url now becomes <code>/AreaName?param=true</code> where I want it to be <code>/AreaName/Test/</code>. </p>
  
  <p>This is my routemap:</p>
  
  <pre><code>        context.MapRoute(
              "default",
              "AreaName/{controller}/{action}/{param}",
              new { controller="Test", action = "Index", param=UrlParameter.Optional },
          );
  </code></pre>
  
  <p>I am submitting a form using "post" from MyJS.js to <code>SomeAction</code>. </p>
  
  <p>Is there any alternative/workaround method for doing this? In nutshell, I want these three things:</p>
  
  <ol>
  <li>Redirect to <code>Index</code> action.</li>
  <li>Pass the value of <code>param</code> from <code>SomeAction</code> to <code>Index</code>.</li>
  <li>Keep the URL: <code>http://localhost/AreaName/Test/</code></li>
  </ol>