ViewResult and lookup directories

258 Views Asked by At
new ViewResult() { ViewName = "Error_403" };

in this case .net looks through current controller view directory (~/Views/Home/) and in shared (~/Views/Shared/)

Is there any way to point to specific directory right here ViewName = @"Errors\Error_403"?
Or may be any other simple solutions?

1

There are 1 best solutions below

0
Tommy On BEST ANSWER

Try something like this:

   New ViewResult(){ViewName="~/Views/SomeDir/Error_403.aspx"};

See here for a similar issue: StackOverflow