Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Need help. DropDownList with ModelBinding. Getting "has a SelectedValue which is invalid because it does not exist in the list of items" ERROR

$
0
0
Hi

I have a dropdownlist in my

I get the following error:

'ddlEditSRNumber' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value



The markup language is the following

<td><asp:DropDownList ID="ddlEditSRNumber" runat="server" Width="200" AppendDataBoundItems="true"
                        SelectedValue="<%# Item.FACRECORD.FAC_RECORD_UID %>"
                        SelectMethod="GetSubmitterResponseNumbers"><asp:ListItem Text="[Select]" Value="0" /></asp:DropDownList><span style="color: red;"><sup>*</sup></span><asp:CompareValidator ID="cvEditSRNumber" runat="server"
                        ControlToValidate="ddlEditSRNumber" ValueToCompare="0" Operator="NotEqual" Display="None"
                        ErrorMessage="You are required to select a submitter response number."
                        ValidationGroup="vgEditResponseObjection" /></td>

I check the VALUE content from the SelectMethod which is used to bind the dropdownlist with the value matching the edited value of the Selected Value. They do match. I am not sure what is cause this error. The binding value for the SelectedValue is a different ItemType from the dropdownlist. A different item type was used to populate the dropdownlist options.

Any help is appreciated.


Viewing all articles
Browse latest Browse all 23244

Trending Articles