is it possible to redirect to an aspx page in an (asp.net-mvc3 )controller action? What should be the return type of the action (ActionResult?) and which redirect method s
You can redirect to anywhere from MVC action and you have to use RedirectResult
for that. RedirectResult
is a type of ActionResult
.
For ex.
public RedirectResult RedirectToAspx()
{
return Redirect("/pages/index.aspx");
}
Yes, just like razor.
View:
test.aspx
Controller:
public ActionResult test()
{
ViewBag.Message = "test。";
return View();
}