@foreach(Model.Comments.Where(x => x.CommentParentID == 0) 中的 var 评论列表){
<div class="blog-comment">
<div class="comment-info">
<div class="user-info">
@if (commentlist.AllowViewingProfiles)
{
<a href="@Url.RouteUrl("CustomerProfile", new { id = commentlist.CustomerId })" class="username">@(commentlist.CustomerName)</a>
}
else
{
<span class="username">@(commentlist.CustomerName)</span>
}
<div class="avatar">
@if (!String.IsNullOrEmpty(commentlist.CustomerAvatarUrl))
{
<img src="@(commentlist.CustomerAvatarUrl)" class="avatar-img" title="avatar" alt="avatar" />
}
</div>
</div>
</div>
<div class="comment-content">
<div class="comment-time">
@T("Blog.Comments.CreatedOn"): <span class="stat-value">@commentlist.CreatedOn.ToString("g")</span>
<div class="buttons">
<input type="submit" id="reply" class="button-1 blog-post-add-comment-button" onclick="return showHide();" />
@Html.Hidden("CommentParentID",@commentlist.Id)
</div>
</div>
<div class="comment-body">
@Html.Raw(Nop.Core.Html.HtmlHelper.FormatText(commentlist.CommentText, false, true, false, false, false, false))
</div>
</div>
<div class="clear">
</div>
}
我正在使用 @Html.Hidden("CommentParentID",@commentlist.Id) 为 ChildComment 设置值 CommentParentID(如果有)。
在下面的操作中,我想将 CommentParentID 作为参数传递。
@Html.ActionLink("Reply", "BlogCommentReply", "Blog", new { blogPostId = blogPostId, CommentParentID=CommentParentID,captchaValid = Model.AddNewComment.DisplayCaptcha }, null)
我如何在 Controller 中检索此隐藏字段值?或者我怎样才能传递那个值?