asp.net mvc - How will model binder deals with Readonly & disabled -
i have following 2 items , 1 readonly:-
@html.textboxfor(model => model.technology.tag, new { @readonly = "readonly" })
while other disabled:-
@html.dropdownlistfor(model => model.customer.name, ((ienumerable<tms.models.accountdefinition>)viewbag.customers).select(option => new selectlistitem { text = (option == null ? "none" : option.org_name), value = option.org_name.tostring(), selected = (model != null) && (model.customer != null) & (option.org_name == model.customer.name) }), "choose...", new { disabled = "disabled" })
so asp.net mvc model binder bind 2 items? , or ignore read-only , disabled fields ?
readonly , disabled effects client-side only, meaning behavior on server not change based on parameters.
if tried before posting question, have noticed posted data doesn't model, because form data not include disabled , readonly fields (or @ least, on common browsers).
in other words : yes, model binder fine binding fields, never receive data if field disabled or readonly.
Comments
Post a Comment