This project is read-only.

Virtual Path Attribute

Sep 19, 2013 at 2:30 PM

In the generated .cs files which are created from running the custom tool, we see the line :
In our application, we potentially have several views from different projects which live in 'Default/DisplayWWW.cshtml'. Is there an easy way to add a custom namespace to this path to disambiguate it?


Sep 19, 2013 at 3:30 PM
There isn't a way to modify the page virtual path as yet. It shouldn't be hard to change the generator to support this. However once the virtual path is namespaced, you'd have to change your controller to return the right "namespaced" View. At this point, you're better off using Areas as a simpler mechanism for achieving this - you get namespacing for free and don't quite have to bother with modifying your controller. Does this make sense?
Sep 19, 2013 at 5:46 PM
We you instantiate PrecompiledMvcEngine, you can pass a baseVirtualPath as the second param, which lets you change the effective virtual path for all the pages within an assembly. You may want to play around with that.