asp.net mvc4中的未将对象引用设置到对象的实例。
@modelList<Works.Models.movie>@{Layout=null;}<!DOCTYPEhtml><html><head><metaname="vie...
@model List<Works.Models.movie>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>hehe</title>
</head>
<body>
<div id="disp" style="width:300px; height:300px; border:1px solid;">
@foreach (var item in Model)
{
<table>
<tr>
<td>回复人:</td>
<td>@Html.LabelFor(x=>item.movieName)</td>
</tr>
<tr>
<td colspan="2" style="width:300px;height:300px;">
@Html.DisplayFor(x=>item.moviePrice)
</td>
</tr>
</table>
}
</div>
<fieldset>
<legend>评论</legend>
<div>
@using (Html.BeginForm(FormMethod.Post))
{
<table>
<tr>
<td>
评论
</td>
<td>
<input type="text" id="content" />
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="提交" /></td>
</tr>
</table>
}
</div></fieldset>
movie表里面是有数据的。而且数据库已经连通 展开
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>hehe</title>
</head>
<body>
<div id="disp" style="width:300px; height:300px; border:1px solid;">
@foreach (var item in Model)
{
<table>
<tr>
<td>回复人:</td>
<td>@Html.LabelFor(x=>item.movieName)</td>
</tr>
<tr>
<td colspan="2" style="width:300px;height:300px;">
@Html.DisplayFor(x=>item.moviePrice)
</td>
</tr>
</table>
}
</div>
<fieldset>
<legend>评论</legend>
<div>
@using (Html.BeginForm(FormMethod.Post))
{
<table>
<tr>
<td>
评论
</td>
<td>
<input type="text" id="content" />
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="提交" /></td>
</tr>
</table>
}
</div></fieldset>
movie表里面是有数据的。而且数据库已经连通 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询