我试图从表单中发布一些信息,但它一直向 Comment Controller 发布空值,而不是在页面上输入的内容....
@using (Html.BeginForm("SubmitComment", "Comment",FormMethod.Post))
{
<fieldset>
<legend>Submit a comment</legend>
<input id="comment" type="text" />
<button type="submit">Submit</button>
</fieldset>
}
有什么想法吗?
请您参考如下方法:
将 name="comment" 属性添加到输入。
