Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 23, 2012 06:38 AM by meoghe
Jun 05, 2012 09:37 PM|LINK
I have a controller HomeController in Index Method I want to redirect to another controller of different application.
Should I have to Write Response.Redirect or there is another way for doing it in MVC3
Sorry I am new to MVC3.
Jun 05, 2012 09:43 PM|LINK
In MVC3 You Can set the Context.Result to a RedirectToActionResult
Context.Result = new RedirectToRouteResult(...);
Context.Result = RedirectResult;
Jun 05, 2012 10:00 PM|LINK
Thanks for reply
if I use Context.Result then System.Runtime.Remoting.Contexts does not contain definition of 'Result'.
Sorry If sound stupid new to MVC :)
Jun 07, 2012 08:26 AM|LINK
I suggest you can organize these project using Areas, then you just need to pass a area paramete in the actionlink, it will redirect your to that action. Please refer to:
Hope this helpful
Nov 23, 2012 06:38 AM|LINK
You try use this
return RedirectToAction("kiss", "meoghe");// RedirectToAction("action name", "controller name"); // meogheController =>"meoghe" is controller name
If you use "ActionResult" for return type on method, you must use "return" for RedirectToAction.
Wish that help you