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

2
  • 1
    possible duplicate of Why do we use HTML helper in ASP.NET MVC? Commented Jul 2, 2014 at 5:02
  • No sir this question is different... Commented Jul 2, 2014 at 5:24

2 Answers 2

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">

Sign up to request clarification or add additional context in comments.

1 Comment

even html support validation
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.