C# 表格投寄无效

C# 表格投寄无效,c#,asp.net-mvc,C#,Asp.net Mvc,我试图发布表单中的一些信息,但它一直向注释控制器发布空值,而不是页面上输入的内容 @using (Html.BeginForm("SubmitComment", "Comment",FormMethod.Post)) { <fieldset> <legend>Submit a comment</legend> <input id="comment" type="text" /> <b

我试图发布表单中的一些信息,但它一直向注释控制器发布空值,而不是页面上输入的内容

@using (Html.BeginForm("SubmitComment", "Comment",FormMethod.Post))
{
     <fieldset>
        <legend>Submit a comment</legend>
        <input id="comment" type="text" />

        <button type="submit">Submit</button>

    </fieldset>
}
@使用(Html.BeginForm(“SubmitComment”、“Comment”、FormMethod.Post))
{
提交评论
提交
}

有什么想法吗?

name=“comment”
属性添加到输入中。

name=“comment”
属性添加到输入中。

您可以将您的
提交建议
操作的代码发布到您的
CommentController
上吗?请发布提交建议操作的代码。你是如何处理的。你能在你的
CommentController
上发布你的
SubmitComment
操作的代码吗?请发布SubmitComment操作的代码。你是怎么处理的。