i'm creating a web application with asp.net mvc and struggling with a redirect to a mobile view after pushing a login button. i isolated the problem from the case and created a dummy controller and view
Controller:
public class DummyController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult foo()
{
return RedirectToAction("index", "home");
}
public void bar()
{
Response.Redirect("/home/index");
}
}
View:
<div>
<a href="/dummy/foo"><button>redirect to action</button></a>
</div>
<div>
<a href="/dummy/bar"><button>response redirect</button></a>
</div>
by pushing the first button (foo method) from a mobile devices the redirect does nothing pushing the second button (bar method) the redirect works fine and delivers the expected mobile site (Index.mobile.cshtml)
is there anything i have to keep in mind when using "RedirectToAction" and mobile views?