AllowModelMembers
is set to true when creating the TemplateContext
. Is this by design?
{
"query": {
"bool": {
"must_not": [
{ "term": { "ContentItemId": "4ak2n0ebx0vm4x5mhjcez1vrw1" } }
]
}
}
}
It took me for a while to understand why an HTML input has an empty value even though a view model has a value.
Normally when a model state has an error, we return an empty view model but it is not the case for Orchard that we return an output of HttpGet Edit method.
This means our view model has a value from a database which is different from a normal MVC action that we return an empty view model when getting a validation error.
This is new for me because I haven't realized how an HTML input is assigned a value.
It doesn't matter if a view model has value or not. If a model state has an error, an HTML input will be set value from a model state.
Here is the screen short of a workflow.