TextBox
@Html.TextBox("ControlName",
"Some Value",
new { onclick = "alert('Razor Engine')" });
@Html.TextBoxFor(m => m.Value, new
{
onclick = "alert('Razor Engine')",
@Value = "Some Value"
});
TextArea
@Html.TextArea("ControlName",
"Some Value",
new { onclick = "alert('Razor Engine')" });
@Html.TextAreaFor(m => m.Value, new
{
onclick = "alert('Razor Engine')"
});