mrgeesbigcircus

I'm a web designer and developer from Nottingham. I mostly work in C# for getting things done, although I have a penchant for obscure and interesting aspects of programming. I come from a background of generally non-IT environments, so I tend to see things from a "human" perspective.

Away from the computer, I love cycling and mountain biking, as well as dusting off my rather large collection of records every now and then. I'm also a big fan of graphic design, illustration and typography.

I'm married to my beautiful wife Luce and we have a gorgeous girl called Bibi.

Jul 9

ASP.NET MVC: Return a View from a different Controller

The problem: You want to return a View that’s in a different Controller to the one you’re currently in. Doing return View(“/OtherController/OtherView”); results in an exception, as MVC looks first in the current Controller folder structure, then the Shared folder structure.
The “proper” solution: Copy the View you want into the Shared folder structure and reference it.

Quick & dirty solution: Use return Redirect(“OtherController/OtherView”); Hurrah!

Posted via email from The wonderful world of mrgeesbigcircus | Comment »