I hope you are new to MVC.
If you have a view model in the cshtml file, just use the view model and loop the same way to generate the controls dynamically.
Ex:
If your view model is Demo.ViewModels.EmployeeData
foreach (Demo.ViewModels.EmployeeData emp in Model.EmployeeViewList)
{
<div>
<@Html.TextBoxFor(model => emp.EmpName)
<@Html.TextBoxFor(model => emp.Designation)
</div>
}
You can also use for loop instead of foreach loop