0

We are in the process of converting a Ruby on Rails 3.2 App to .NET MVC 4 using C# as the language. Is there a way to render a view from another controller within the current controller in C# similar to the way Rails does.

For example, in Rails, in your current controller you can call:

render :template => 'another_controller/action'

When searching online all I could find were articles/SO questions regarding rendering partial views from a C# controller. Is rendering a full view from another controller considered not best practice?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Jonathan Moriarty
  • 498
  • 2
  • 5
  • 13
  • possible duplicate of [Display a view from another controller in ASP.NET MVC](http://stackoverflow.com/questions/879852/display-a-view-from-another-controller-in-asp-net-mvc) – fejesjoco Nov 13 '14 at 14:32

1 Answers1

1

You need to call RedirectToAction

Pass it the action name and the controller name, each as a string.

Slappywag
  • 1,143
  • 1
  • 17
  • 27