@ Html.labelfor(model => model.statename,htmlattributes:new {@class =" control-label col-md-2"}) [英] @Html.labelfor(model => model.statename, htmlattributes: new { @class = "control-label col-md-2" })
问题描述
如果有人知道这个model => model.StateName来自哪里以及htmlAttributes:new {@class =control-label col-md-2}
使用实体框架在.cshtml文件中自动生成
it will be heplful if some one can tell where from this "model => model.StateName" is comming and also about htmlAttributes: new { @class = "control-label col-md-2" }
auto generated in .cshtml file using entity framework
@Html.LabelFor(model => model.StateName, htmlAttributes: new { @class = "control-label col-md-2" })
我有什么试过:
auto genarted code:
@ Html.LabelFor(model => model.StateName,htmlAttributes:new {@class =control-label col-md-2})
What I have tried:
auto genarted code :
@Html.LabelFor(model => model.StateName, htmlAttributes: new { @class = "control-label col-md-2" })
推荐答案
以下行:
@class =control -label col-md-2
是bo otstrap选择器。 (bootstrap.css样式表类)
model => model.StateName
.. .this是模型对象的属性。您的模型对象类将在cshtml的顶部定义为@model myModel或类似的东西。
The following line:
@class = "control-label col-md-2"
is "bootstrap" selectors. (bootstrap.css stylesheet classes)
"model => model.StateName"
...this is a property on the model object. Your model object class will be defined at the top of the cshtml as "@model myModel" or something like that.
这篇关于@ Html.labelfor(model => model.statename,htmlattributes:new {@class =" control-label col-md-2"})的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!