其中View的代码如下所示
@model OrderRecordModel.Model.OrderInfo
@{
ViewBag.Title = "订货记录基本信息";
}
<div>
<div class = "table-responsive">
<table class = "table">
<tbody>
<div class = "table-responsive">
<table class = "table">
<caption>订货记录表</caption>
<tbody>
<tr>
<th>用户清册工程名称</th>
<td>@Html.LabelFor(Model=>Model.userInventory)</td>
<th></th>
<td></td>
<th></th>
<td></td>
</tr>
<tr class="table-gap">
</tr>
<tr>
<th>产品说明</th>
<td>@Html.LabelFor(Model=>Model.PrdDesc)</td>
<th>装置数量</th>
<td>@Html.LabelFor(Model=>Model.deviceQuantity)</td>
<th>屏柜数量</th>
<td>@Html.LabelFor(Model=>Model.cubicleQuantity)</td>
</tr>
</div>
</tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</div>
Controller代码如下
public ActionResult OrderRecordInfo(string orderNum)
{
string str_orderNum = orderNum;
//HttpCookie cookie = Request.Cookies["ordernum"];
SessionHelper sessionHelper = new SessionHelper();
OrderInfo orderInfo = new OrderInfo();
try
{
}
catch (System.NullReferenceException)
{
Response.Write("<script language=javascript>window.location.href=document.URL;</script>");
}
if (str_orderNum == "" || string.IsNullOrEmpty(str_orderNum))
{
Response.Write("<script language=javascript>window.location.href=document.URL;</script>");
}
else
{
System.Web.HttpContext.Current.Session.Add("orderNum", str_orderNum);
OrderRecordModel.DataAccess.OrderRecordBaseInfo orderInfoFunc =
new OrderRecordModel.DataAccess.OrderRecordBaseInfo();
orderInfo = orderInfoFunc.GetBaseInfos(str_orderNum);
}
return View(orderInfo);
}
因为是流程审核的代码,里面的字段确实有点多,没有把所有代码放上来。问题是这样的:
我单步调试的时候,model已经取到了数据库的数据了,但是把这个model传入View的时候,View的显示确实像这样。
字段名后面的哪些英文都是model的属性的名称。
电脑配置:WIN10
IDE: VS2012Ultimate
代码写得丑,各路大神轻喷