Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I can't seem to get this code to work. How do I get the
TextBoxFor
to show on the screen? Nothing I try works.
@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 class="col-sm-10">
@if (items.PageItemTypeId == (int)HOD.Controllers.PageItemTypesEnum.MainTextContent)
@Html.TextBoxFor(x => items.PageContent, new { @class = "form-control", @placeholder = "Content" });
<input type="hidden" id="pageTypeId" />
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.