Kir*_*ira 10 asp.net asp.net-mvc razor asp.net-mvc-3
浏览器在我的表单旁边显示"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" />
}
Run Code Online (Sandbox Code Playgroud)
Had*_*das 32
将您的代码更改为(添加@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" />
}
Run Code Online (Sandbox Code Playgroud)
将行更改@Html.BeginForm("NewComment", "Difficultes", FormMethod.Post)
为@using(Html.BeginForm("NewComment", "Difficultes", FormMethod.Post))
| 归档时间: |
|
| 查看次数: |
7302 次 |
| 最近记录: |