我无法让这段代码运行。我该如何让屏幕显示TextBoxFor
?我尝试过的方法都无效。
@foreach (var items in Model.Pages[0].Items){
<div class="form-group">
<label for="pageType" class="col-sm-2 control-label">Label:</label>
<div class="col-sm-10">
@{
string htmlOutput;
if (items.PageItemTypeId == (int)HOD.Controllers.PageItemTypesEnum.MainTextContent)
{
htmlOutput = @Html.TextBoxFor(x => items.PageContent, new { @class = "form-control", @placeholder = "Content" }).ToHtmlString();
Response.Write(htmlOutput);
}
<input type="hidden" id="pageTypeId" />
</div>
</div>