gpt4 book ai didi

asp.net - 在页面上得到 "System.Web.Mvc.Html.MvcForm"

转载 作者:行者123 更新时间:2023-12-04 02:34:35 26 4
gpt4 key购买 nike

浏览器在我的表单旁边显示“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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com