Can you make Asp.net MVC View wireup compile time safe?

156 views Asked by At

Take the standard return statement for a controller:

return View("Index");

is there a way to make this thing compile time safe? using static reflection or some other trick?

1

There are 1 answers

7
SLaks On BEST ANSWER

Yes; you're looking for this.

T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring to controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any.