In the above screenshot we have a EmployeeId property in View model. We have applied HiddenInput Data Annotation attribute on this property. we have also set its DisplayValue property to true. The true value indicates that the value of the hidden field will be shown on UI with a label.

Controller :

In the controller, in Register Action method we have created object of view model, assigned 5 to EmployeeId property and this object is passed as model to the View. So, when the view renders it shows the value 5 on UI.