HtmlHelper extension method vs partial view?

I personally think that partial view is more or less similar to usercontrol in asp.net, which act as a group of reusable functional elements. For example, if you need to make a login control box that may appear across the whole site, partial view would be better. What's more for partial view is, it is actually self-contained with its own rendering/processing strategy (and may have its own state as well)

On the other hand, htmlhelper is just tools for saving coding time and maintain, somehow better readability on your codes.


It's much easier to write tests for HTML helpers (which are just methods) than partial views. If I'm writing something that has logic, such as different output based on the contents of viewdata, then I use a helper with tests around it. If I'm creating a piece of reusable content without any real logic, then I'll probably use a partial view.


HtmlHelpers - small bits of HTML (custom links, buttons, inputs, etc)

PartialViews - more complex things (forms, headers, footers, list items, etc)