2012-08-08 13 views
9

Il browser sta visualizzando "System.Web.Mvc.Html.MvcForm" accanto al modulo. Come posso nasconderlo? Ecco il codice del modulo.ha ottenuto "System.Web.Mvc.Html.MvcForm" a pagina

@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" /> 
    } 

risposta

32

modificare il codice per (Aggiungere il @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" /> 
} 
4

Modificare la linea @Html.BeginForm("NewComment", "Difficultes", FormMethod.Post) a @using(Html.BeginForm("NewComment", "Difficultes", FormMethod.Post))

Problemi correlati