两者之间有什么区别
var groupDetailsArray: [String]? {
didSet{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier: "Identifier here") as? controllerHere
controller?.grpDataArray = groupDetailsArray
}
}
和
@Html.LabelFor(model => model.Soluongton, htmlAttributes: new { @class = "control-label col-md-2" })
什么是@Html.LabelFor(model => model.Soluongton, new { htmlAttributes = new { @class = "control-label col-md-2" } })
?
答案 0 :(得分:1)
@Html.LabelFor(model => model.Soluongton, htmlAttributes: new { @class = "control-label col-md-2" })
将呈现HTML代码:
<label class="control-label col-md-2" for="Soluongton">Soluongton</label>
@Html.LabelFor(model => model.Soluongton, new { htmlAttributes = new { @class = "control-label col-md-2" } })
将呈现HTML代码:
<label for="Soluongton" htmlAttributes="{ class = control-label col-md-2 }">Soluongton</label>
如您所见,第二个@Html.LabelFor
将呈现错误的HTML输出。