0

As we know that in asp.net mvc if we use

@HtmlTextbox("t1",Model.val)

then it will create html output as

<input type="text" value="Value of val in Model"/>

but rather using htmlhelpers in asp.net mvc if I directly use

<input type="text" value="@Model.val"/>

So which is better using htmlhelpers or directly html tags in asp.net mvc

शेखर
  • 17,412
  • 13
  • 61
  • 117
  • 1
    possible duplicate of [Why do we use HTML helper in ASP.NET MVC?](http://stackoverflow.com/questions/4681883/why-do-we-use-html-helper-in-asp-net-mvc) – शेखर Jul 02 '14 at 05:02
  • No sir this question is different... –  Jul 02 '14 at 05:24

2 Answers2

1

I think <input type="text"> is faster then the HTML helper .

but in case of validation I recommend HTML Helper it is automatically handle validation if provided in model.

else you need to handle validation in case of <input type="text">

Amit
  • 15,217
  • 8
  • 46
  • 68
0

The version that requires least computing (the 2nd one) is faster, but the 1st one is more readable.

andypopa
  • 536
  • 6
  • 15