浏览器在我的表单旁边显示“System.Web.Mvc.Html.MvcForm”。我怎样才能隐藏它?
这是表单代码。
@Html.BeginForm("NewComment", "Difficultes", FormMethod.Post)
{
@Html.HiddenFor(m => m.diff.id_diff)
<table>
<tr><label><b>Nouveau commentaire</b></label></tr>
<tr>
<td><b>Nom :</b></td><td>@Html.TextBoxFor(m=>m.pseudo)</td>
</tr>
<tr>
<td><b>Commentaire :</b></td><td>@Html.TextAreaFor(m=>m.nouveau)</td>
</tr>
</table>
<input type="submit" value="Ajouter" />
}
最佳答案
将您的代码更改为(添加 @using
):
@using (Html.BeginForm("NewComment", "Difficultes", FormMethod.Post))
{
@Html.HiddenFor(m => m.diff.id_diff)
<table>
<tr><label><b>Nouveau commentaire</b></label></tr>
<tr>
<td><b>Nom :</b></td><td>@Html.TextBoxFor(m=>m.pseudo)</td>
</tr>
<tr>
<td><b>Commentaire :</b></td><td>@Html.TextAreaFor(m=>m.nouveau)</td>
</tr>
</table>
<input type="submit" value="Ajouter" />
}
关于asp.net - 在页面上得到 "System.Web.Mvc.Html.MvcForm",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11860902/