Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:52:14+00:00 2026-05-27T05:52:14+00:00

The exception says my dropdown has a SelectedValue which is invalid because it does

  • 0

The exception says my dropdown “has a SelectedValue which is invalid because it does not exist in the list of items”

This is after selecting the item from a previous page. The dropdown is bound to a dataset filled with data from a stored procedure. The value from the database has an ampersand in it which is encoded in the html source. When I remove the ampersand from the data it doesn’t throw the exception anymore. I think its because it can’t match the posted value to the encoded html but I’m not sure how the binding works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:52:15+00:00Added an answer on May 27, 2026 at 5:52 am

    The issue was in saving the dropdown value directly to the object before redirecting to the next page. I was saving the Encoded value and needed to save the Decoded value. I called Server.HtmlDecode when saving it and it no longer throws the exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Exception is: 'Country' has a SelectedValue which is invalid because it does not exist
Exception Thrown: System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable Does this mean I missed marking
Constructor for PHP's exception has third parameter, documentation says: $previous: The previous exception used
Exception in thread Thread-2 java.lang.NumberFormatException: For input string: 3 int test = Integer.parseInt(result[0]); This
This exception peppers our production catalina logs on a simple 'getParameter()' call. WARNING: Parameters:
I have a windows service which is installed to C:\Windows\System32. It has a usual
I'm using this code to find an item by text: ddlCountry.Items.FindByText(someCountry).Selected = true; I
The Control.Exception documentation says I can do the following to create my own exception:
The exception says that there is a network related problem, or that the SQL
It's my understanding that common wisdom says to only use exceptions for truly exceptional

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.