Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 375
Maslow Avatar asked Apr 07 '10 20:04

Maslow


1 Answers

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.

like image 164
SLaks Avatar answered Sep 22 '22 10:09

SLaks