I am creating a simple blog applicaton. I have to add comments to a blog post. I have a line in my code which looks like this:
<input type="hidden" name="Comment.BlogID" value="@Model.Blog.BlogID" />
Basically, I am setting the Comment.BlogID to Model.Blog.BlogID
is there a way to do this using HTML.Hiddenfor.
I tried the code below but that does not work.
@Html.HiddenFor(model => model.Comment.BlogID, new { value = @Model.Blog.BlogID });