I am increasingly finding situations where my ASP.NET MVC view requires some logic to perform layout. These routines have no place being in either my model or my controller. I have 3 options:
- Write lots of <% %> inline in the view.
- Write less <% %> in a number of partial views.
- Write an HtmlHelper Extension method.
It is the last option that confuses me. Is it OK to do this if the logic is specific to only that one view? The extension would be visible to the Html object of every other view, and it will never be needed.
Any suggestions?