Is there a way to concatenate strings in html attributes?

后端 未结 4 1928
名媛妹妹
名媛妹妹 2021-02-05 04:51

I\'m using MVC3 and I wanted to use a partial view to create dynamic DOM elements. This is my current partial view:

@model MVCApp.ViewModels.TitlesViewModel

<         


        
4条回答
  •  有刺的猬
    2021-02-05 04:58

    Here is what you need to do.

    id="label_@Model.Id"
    

    Underscore(_) is required.For me passing id without Underscore made an issue. Happy conding.

提交回复
热议问题