In my controller I have three methods:
public ActionResult DisplayPostsComments()
{
var viewModel = new DisplayPostsCommentsWiewModel();
return View(viewModel);
}
[HttpPost]
public ActionResult DisplayPostsComments(DateTime start, DateTime end)
{
List<PostModel> postList = new List<PostModel>();
var posts = postDAL.GetPost(start, end);
var comments = commentDAL.GetComments(posts);
var viewModel = new DisplayPostsCommentsWiewModel(posts, comments);
viewModel.start = start;
viewModel.end = end;
return View(viewModel);
}
public ActionResult DeleteComment(int commentId, DateTime start, DateTime end)
{
// commentDAL.DeleteComment(commentId);
return RedirectToAction("DisplayPostsComments", new { start = start, end = end });
}
}
I expect
return RedirectToAction("DisplayPostsComments", new { start = start, end = end });
to call the second method with parameters. But what I've achieved is a call to the first method. What I'm doing wrong?