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

前端 未结 5 1938
离开以前
离开以前 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:40

    If you are using @HTML.DisplayFor(model=>model.CustomerName) It will render as text, It will not shows any tag inside the values.

    If you want to bind the "DisplayFor" using span , Use the below tag,

    @Html.DisplayFor(model=>model.CustomerName)
    

提交回复
热议问题