1
我有一個像下面的詳細視圖應用HTML效果在asp.net mvc的
我想表明與HTML效果是相關領域(如果有的話)
這個細節視圖頁面對於上述觀點
@for (int i = 0; i < Model.ListProductFields.Count; i++)
{
<div class="form-group">
@Html.LabelFor(x => x.ListProductLables[i].ProductFieldNameEn, Model.ListProductLables[i].ProductFieldNameEn, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.HiddenFor(m => m.ListProductFields[i].Field_ID)
@Html.TextAreaFor(m => m.ListProductFields[i].Field_Value_EN, new { @class = "form-control summernote", @row = 5 })
</div>
</div>
<div class="form-group">
@Html.LabelFor(x => x.ListProductLables[i].ProductFieldNameAr, Model.ListProductLables[i].ProductFieldNameAr, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.HiddenFor(m => m.ListProductFields[i].Field_ID)
@Html.TextAreaFor(m => m.ListProductFields[i].Field_Value_AR, new { @class = "form-control summernote", @row = 5 })
</div>
</div>
}
在你的'LabelFor()'方法中不需要第二個參數 - 可以只是'@ Html.LabelFor(x => x.ListProductLables [i] .ProductFieldNameEn,new {@class = 「control-label col-md-2」})'但你顯示的圖像有一些'textarea'元素,但代碼片段不顯示它們? –
非常抱歉,編輯它 – kez
這是編輯視圖嗎?如果不是,那麼你可以使用'@ Html.Raw(m => m.ListProductFields [i] .Field_Value_EN)'(並且放入帶有邊框的div中,如果這是你想要的視覺效果) –