【发布时间】:2013-01-07 12:23:18
【问题描述】:
<div class="forms-box">
<div class="inputs">
@Html.HiddenFor(model => model.AddNewComment.CommentParentID)
@Html.LabelFor(model => model.AddNewComment.CommentText)
<div class="input-box">
@Html.TextAreaFor(
model => model.AddNewComment.CommentText,
new { @class = "comment-text" })
</div>
@Html.ValidationMessageFor(model => model.AddNewComment.CommentText)
</div>
在代码中:
我从两个中得到一个值
Model.AddNewComment.CommentParentID 或
Model.AddNewComment.CommentText
在我的控制器中。
public ActionResult BlogCommentReply(
int blogPostId,
BlogPostModel model,
bool captchaValid)
{
}
【问题讨论】:
-
你能分享你的 BlogPostModel 代码吗?另外,您是发布到 HttpPost 操作还是通用 GET/POST 操作?
标签: c#-4.0 razor asp.net-mvc-4