The browser is displaying "System.Web.Mvc.Html.MvcForm" next to my form. How can I hide it? Here is the form code.
@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" />
}
Change your code to (Add the @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" />
}
Change the line @Html.BeginForm("NewComment", "Difficultes", FormMethod.Post)
to @using(Html.BeginForm("NewComment", "Difficultes", FormMethod.Post))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With