0

您好,我正在构建一个显示来自数据库的数据的网页。像这样:

在此处输入图像描述

为什么没有显示结果?最好的,

@model Orchard.Staff.Models.StaffPart
    <fieldset>
      <legend>Map Fields</legend>

      <div class="editor-label">
        @Html.LabelFor(model => model.StaffID)
      </div>
      <div class="editor-field">
        @Html.DisplayFor(model => model.StaffID)
        @Html.ValidationMessageFor(model => model.StaffID)
      </div>
      <div class="editor-label">
        @Html.LabelFor(model => model.CName)
      </div>
      <div class="editor-field">
        @Html.DisplayFor(model => model.CName)
        @Html.ValidationMessageFor(model => model.CName)
      </div>

      <div class="editor-label">
        @Html.LabelFor(model => model.EName)
      </div>
      <div class="editor-field">
        @Html.DisplayFor(model => model.EName)
        @Html.ValidationMessageFor(model => model.EName)
      </div>
4

1 回答 1

1

尝试使用

 @Html.TextBoxFor(model => model.EName)

代替,

 @Html.DisplayFor(model => model.EName)

如果这不起作用,请确保在将模型发送到视图之前正确填充模型

于 2013-02-05T01:39:14.553 回答