Render span tag with title attribute with ASP.NET MVC 3 Helpers

前端 未结 5 1940
离开以前
离开以前 2021-02-05 07:11

It\'s possible to add a HTML title attribute to an input tag like so:

@Html.TextBoxFor(model => model.Name, new { title = \"Customer name\" })
         


        
5条回答
  •  囚心锁ツ
    2021-02-05 07:50

    Ugly, but works ;-) (required field, without rendering .EditorFor content get lost during submit, even HTML comment around does not work, tested on System.Web.Mvc 5.0.0.0)

    @Html.EditorFor(model => model.UserName)
     model.UserName)>
    

    Original looked like:

    
    

提交回复
热议问题