I personally prefer option 3 ("Write the HtmlHelper Extension method"), because those code bodies can be easily tested.
I really want extension methods to be placed on inner or nested classes, because you're right, you will start polluting your namespaces with tons of extension methods that are used in only one view.
I would recommend sequestering these HtmlHelper extension methods in static classes in the user namespace for each view that you manually reference in the view to limit the number of extension methods available in your project.
source
share