ASP.NET MVC 3: Override “name” attribute with TextBoxFor

前端 未结 11 1512
臣服心动
臣服心动 2020-11-28 05:41

Is it possible when using Html.TextBoxFor to override the name attribute?

I have tried with no success. I need to use TextBoxFor to get client side vali

11条回答
  •  执念已碎
    2020-11-28 06:10

    ben's answer got me what I was looking for except you need to wrap in in Html.Raw

    @Html.Raw(Html.TextBoxFor(x => x.Data).ToString().Replace("Data", "NewData"))
    

提交回复
热议问题