I have a problem arising in the form I'm trying to post. In a scenario where the form is not validated, I take the standard call route ModelState.AddModelError()and then return the result of the scan.
The fact is that HTML. * helpers must collect the published value when rendering, and I notice that my text fields ONLY do this if I include them in the list of postback action parameters, t is required because some forms have too many fields to list them as parameters.
My action code is approximately:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditDataDefinition(long? id, string name)
{
var dataDefinition = ...
if (!ModelState.IsValid)
{
return View(dataDefinition);
}
}
Now dataDefinition (which is a LINQ to SQL object) has a MinVolume field, processed in the view by this line:
Minimum: <%= Html.TextBox("MinVolume", null, new { size = 5 })%>
, ModelState, , , , . UNLESS . " ", :
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditDataDefinition(long? id, string name, string minVolume)
- . , , , .
?