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.
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:
http://msdn.microsoft.com/en-us/library/ee671793.aspx
Hope this helpful
Regards
Please mark the replies as answers if they help or unmark if not.
Feedback to us
pankaj4all20...
Member
77 Points
34 Posts
Redirecting to another controller in MVC3
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.
MahadTECH
Star
8976 Points
1659 Posts
Re: Redirecting to another controller in MVC3
Jun 05, 2012 09:43 PM|LINK
In MVC3 You Can set the Context.Result to a RedirectToActionResult
Good luck`
Mahad Bin Mukhtar
Remember to Mark the replies as Answers
The easiest day was 'yesterday'.
MCP, MCSD
For .NET TECH Blog
pankaj4all20...
Member
77 Points
34 Posts
Re: Redirecting to another controller in MVC3
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 :)
Young Yang -...
All-Star
21343 Points
1818 Posts
Microsoft
Re: Redirecting to another controller in MVC3
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: http://msdn.microsoft.com/en-us/library/ee671793.aspx
Hope this helpful
Regards
Feedback to us
Develop and promote your apps in Windows Store
meoghe
Member
29 Points
74 Posts
Re: Redirecting to another controller in MVC3
Nov 23, 2012 06:38 AM|LINK
You try use this
return RedirectToAction("kiss", "meoghe");// RedirectToAction("action name", "controller name"); // meogheController =>"meoghe" is controller nameIf you use "ActionResult" for return type on method, you must use "return" for RedirectToAction.
^_^
Wish that help you
Best Regards
meoghe