Is @ Html.HiddenFor the correct way to resubmit the displayed data from my view

I am new to mvc and have, no doubt, the main question.

I have a viewmodel that displays some fields as labels only.

When I submit the form back, I still want my view model to contain this data.

The correct way to do this is:

@Html.HiddenFor 

for my value or is there a better / different standard way to do this?

+4
source share
1 answer

Yes, using @ Hidden.For is the correct way to send a tag value.

However, if you watch this in your get method, you can always re-view it in the post method, assuming that the user cannot in any way change the value of the label in the user interface.

+4
source

Source: https://habr.com/ru/post/1486569/


All Articles