This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
[HTML helpers] Do not set Selected
in user's SelectListItem
instances
#524
Comments
dougbu
added a commit
that referenced
this issue
Feb 11, 2015
- #524 - add tests of `DropDownList` and `ListBox` HTML helpers - extend tests of `<select/>` tag helper - add scenario to a functional test New `HtmlHelperSelectTest` does not cover everything. In future (see #453): - use non-`null` `optionLabel` and `htmlAttributes` arguments - confirm value sources and their priorities - mock an `IHtmlGenerator` and confirm how it is called - mock an `IHtmlHelper` and confirm how extension methods call that
dougbu
added a commit
that referenced
this issue
Feb 12, 2015
- #524 - add tests of `DropDownList` and `ListBox` HTML helpers - extend tests of `<select/>` tag helper - add scenario to a functional test New `HtmlHelperSelectTest` does not cover everything. In future (see #453): - use non-`null` `optionLabel` and `htmlAttributes` arguments - confirm value sources and their priorities - mock an `IHtmlGenerator` and confirm how it is called - mock an `IHtmlHelper` and confirm how extension methods call that
dougbu
added a commit
that referenced
this issue
Feb 12, 2015
- #524 - add tests of `DropDownList` and `ListBox` HTML helpers - extend tests of `<select/>` tag helper - add scenario to a functional test New `HtmlHelperSelectTest` does not cover everything. In future (see #453): - use non-`null` `optionLabel` and `htmlAttributes` arguments - confirm value sources and their priorities - mock an `IHtmlGenerator` and confirm how it is called - mock an `IHtmlHelper` and confirm how extension methods call that
dougbu
added a commit
that referenced
this issue
Feb 13, 2015
- #524 - add tests of `DropDownList` and `ListBox` HTML helpers - extend tests of `<select/>` tag helper - add scenario to a functional test New `HtmlHelperSelectTest` does not cover everything. In future (see #453): - use non-`null` `optionLabel` and `htmlAttributes` arguments - confirm value sources and their priorities - mock an `IHtmlGenerator` and confirm how it is called - mock an `IHtmlHelper` and confirm how extension methods call that
Fixed w/ commit 3ced601 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
DropDownList()
,DropDownListFor()
,ListBox()
, andListBoxFor()
all update theSelected
property of the entries in theIEnumerable<SelectListItem>
passed or found inViewData
. These updates handle round-tripping updated values submitted in a form. However use of the passedSelectListItem
instances pollutes the user's objects and makes it difficult to share select lists between different properties in the model.Fortunately not sharing select lists is a viable workaround. Also conflicts are only visible if one call updates the select list and another one just reads the enumerable (because the value is
null
).See legacy CodePlex bug #1913 for more information.
The text was updated successfully, but these errors were encountered: