I'd like to know what kind of performance impact Html helpers have on C# ASP.NET MVC views, especially when setting attribute parameters, and what kind of advantages they have overall (why use them?)
With Html Helpers:
<%= Html.TextBox("firstName", Model.FirstName,
new { @disabled = "disabled", @class = "myCssClass" }) %>
Direct Html:
<input type="text" class="myCssClass" name="firstName"
disabled="disabled" text="<%= Model.FirstName %>"/>
I have quite a few pages that contain between 5 and 15 of such inputs. On top of that Html Helpers allow you to render the form (think Html.BeginForm()) etc. so you potentially end up with 20 or even more Html Helper calls. I think some of them use reflection too, e.g. when you set attributes like the disabled one above.
Isn't there a huge performance impact to do this? Why on earth is it considered better practice to use those helpers? Please somebody give me a good reason :) I'd like to use them but I really fear the performance impact they have.
Are there any real advantages to using Html helpers?