我试图从表单中发布一些信息,但它一直将空值发布到评论控制器,而不是页面上输入的内容。
@using (Html.BeginForm("SubmitComment", "Comment",FormMethod.Post))
{
<fieldset>
<legend>Submit a comment</legend>
<input id="comment" type="text" />
<button type="submit">Submit</button>
</fieldset>
}有什么想法吗?
发布于 2014-05-15 19:41:43
将name="comment"属性添加到输入。
https://stackoverflow.com/questions/23677147
复制相似问题