相关文章推荐
时尚的蘑菇  ·  js ...·  2 年前    · 
豪爽的烈马  ·  IT41460: 8.1.15 DATA ...·  2 年前    · 
含蓄的自行车  ·  MySQL入门 视图 - 知乎·  2 年前    · 
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, I had a moment where I went back to kindergarten and didn't check the data. Syntax works
– dellyjm
                Jul 21, 2014 at 17:08
        

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.