Last post Oct 17, 2018 09:30 AM by Yuki Tao
Oct 16, 2018 10:02 AM|JupiterSailorMoon|LINK
I am having a selectlist that is being populated in the model. Before sending to the view, the SelectList has other items and in the view it has other items.... the SelectedValue is changed!
When being populated in the view, the selectList is changed.
Model.Employee does not seem to be considered to show the Selected Value.
Any help would be appreciated
In the SearchModel, the items Selected is 0 and and Text is All Children
When run from debug mode, the data returned is
<select data-val="true" data-val-number="The field Employee must be a number." data-val-required="The Employee field is required." id="Employee" name="Employee"><option value="0">All Associates</option>
<option selected="selected" value="-1">All (except Children)</option>
Oct 17, 2018 09:30 AM|Yuki Tao|LINK
There are many places in your code are unclear.
What is Model.EmployeeList,Search() in js code?
What is EmployeeList partial view?
What is the use of GetUsersInSelectedGroup?Where to call this function?
The first step in troubleshooting is reproducing the problem. If the community cannot reproduce the problem we're just guessing...
I suggest you could add some breakpoints in your backend code,and enter F12 to open developer tool to check your front end code.
More details about dropdownlist with selectList, you could refer to:
If you have any questions,please post more details:View ,model and controller.