A model consist of X properties. (Say 5 string variables.)
The strongly typed view displays 2 of the 5 properties but does not have an html element for the other 3 properties. When the view post back the method “UpdateModel()”, works as expected, both string1 and string2 have values.
Is there a graceful way to preserve the other 3 values? Do I have to put them in a hidden element? Do I have to put them in a ViewBag and copy them back one by one?
public ActionResult Index()
var mMode = new myModel();
//All 5 strings filled with data.
public ActionResult ButtonToCallNoParms()
var myModelTest = new myModel();
UpdateModel(myModelTest); <<how to get the other three properties not used by view?
<form action="/TestTempData/ButtonToCallNoParms" method="post">
@Html.TextBoxFor(m => m.string1);
@Html.TextBoxFor(m => m.string2);
<input type="submit" value="Text of submit button" />
P.S. This is for a year end process and I do not care about performance, I would like to generically save all that is added to the model for the redirect.