Q:

Blog post comment reply with ajax

I have a problem l need to create a comment reply action for my blog.
public JsonResult ReplyComment(string replycomment, int articleid, int commentid)
    {
        var UserId = Session["UserId"];
        if (replycomment == null)
        {
            return Json(true, JsonRequestBehavior.AllowGet);
        }
        db.ReplyComments.Add(new ReplyComment
        { UserId = Convert.ToInt32(UserId), ArticleId=articleid, CommentId=commentid, Date = DateTime.Now, Paragraph = replycomment });
        db.SaveChanges();
        return Json(false,JsonRequestBehavior.AllowGet);
    }

and here is my ajax code but l have a problem here l cant reach commentid from Model and l need this variable for reply system 
<script type="text/javascript">
  $(document).ready(function () {

    $("#reply").click(function () {

        var usercomment = $("#replycomment").val();
        $.ajax({
            url: '/Home/ReplyComment/',
            data: { replycomment: usercomment, articleid:@Model.ArticleId, commentid:},
            type: 'POST',
            dataType: 'json',
            success: function (data) {
                //alert("yorum gönderildi" + usercomment);
            }
        });
    });
})

my article detail action 
 public ActionResult ArticleDetail(int id)
    {
        var articles = db.Articles.Where(x => x.ArticleId == id).SingleOrDefault();

        if (articles == null)
        {
            return HttpNotFound();
        }
        return View(articles);
    }

so l need to send 2 model to ajax.data 

A:

I think you want to pass the comment ID from AJAX to code behind, but you didnt find the way how to get comment ID. If I understood correctly, then, As this is for reply to comment, whenever you are displaying the comment, you can have the comment id in the div or span whatever you are using to build the DOM. So that, when you click the #reply, you can get the comment id and pass it to code behind.

