@{
int columnId = Html.CurrentColumnId();
dynamic infoData = Html.InfoData();
dynamic prevData = Html.InfoDataPrevious("columnid=@columnId", new { columnId = columnId });
dynamic nextData = Html.InfoDataNext("columnid=@columnId", new { columnId = columnId });
}
<div class="clear padding-top-10 padding-bottom-10">
<div class="web_navs1 zlm_left">
@Html.Partial("subNavPartialleft")
</div>
<div class="web_wz_wc zlm_right">
@Html.Partial("BreadcrumbPartial")
<table class="letterinfo" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr class="head">
<td colspan="2" align="center"><b>班组工作</b></td>
</tr>
<tr>
<td width="100" align="right">上班时间:</td>
<td>@infoData.Sbsj</td>
</tr>
<tr>
<td align="right">当班班长:</td>
<td>@infoData.Dbbz</td>
</tr>
<tr>
<td align="right">工作内容:</td>
<td>
@infoData.Gznr
</td>
</tr>
<tr>
<td colspan="2" align="center"><a href="javascript:history.back()">返回上一页</a></td>
</tr>
</tbody>
</table>
</div>
</div> 以上工作时间、当班班长、工作内容字段都是新添加的自定义字段,发布内容后,前台显示如下:Server Error in '/' Application.
Cannot perform runtime binding on a null reference
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference
Source Error:
Line 19: <tr>
Line 20: <td width="100" align="right">上班时间:</td>
Line 21: <td>@infoData.Sbsj</td>
Line 22: </tr>
Line 23: <tr>
Source File: f:\2019.9.23最新模板\gov5_blue\Templates\gov5_blue\views\班组工作\Detail.cshtml Line: 21
Stack Trace:
请高手指点,谢谢