How can I pass hidden field value from view to controller ASP.NET MVC 5?

The model in the view is ArticlesCommentsViewModel so therefore the parameter in your POST method must match. Your use of

@Html.HiddenFor(model => model.Articles.ArticleId)

is correct, but you need to change the method to

[HttpPost]
public ActionResult Create(ArticlesCommentsViewModel model)

and the model will be correctly bound.

As a side note, your ArticlesCommentsViewModel should not contain data models, and instead should contain only those properties you need in the view. If typeof Articles contains properties with validation attributes, ModelState would be invalid because your not posting all properties of Article.

However, since CommentsViewModel already contains a property for ArticleId, then you could just use

@Html.HiddenFor(model => model.Comments.ArticleId)

and in the POST method

[HttpPost]
public ActionResult Create([Bind(Prefix="Comments")]CommentsViewModel model)

to effectively strip the "Comments" prefix


In your controller, you need to pass the hidden value with the model, for example, if you have a userId as a hidden value, in your Page you add:
@Html.HiddenFor(x => x.UserId)

In your model of course you would already have UserId as well.
In your controller, you need the model as a parameter.
public async Task<ActionResult> ControllerMethod(YourViewmodel model) { model.UserId //this should be your HiddenValue