我似乎无法使此代码工作.如何让TextBoxFor显示在屏幕上?我没有尝试任何作品.
@foreach (var items in Model.Pages[0].Items){
Label:
@{
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);
}
解决方法:
@if (items.PageItemTypeId == (int)HOD.Controllers.PageItemTypesEnum.MainTextContent)
{
@Html.TextBoxFor(x => items.PageContent, new { @class = "form-control", @placeholder = "Content" });
}
标签:c,asp-net-mvc,razor,asp-net-mvc-4
来源: https://codeday.me/bug/20190714/1459500.html