Solved

'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.

Posted on 2011-09-06
2
276 Views
Last Modified: 2012-05-12
This is a question I'm seeing quite a bit and I'm not seeing a perfect fit answer. I've got a form with a series of dropdowns fed by sql datasources in an asp.net page. They pull from different tables.

The problem I've got it that if one of the items in my table gets "deactivated" from my list, it will spit out this error if  someone goes to look at an old record where it was picked.

I'm experiencing that very thing right now in a test. I'm looking for something quick and clean to either add the item/ ignore(?) the error and just not display a value/ a good rational solution.

"deactivated" = I only flag things as "deactivated" most of the time as opposed to deleting them. The table's not that big even with the "deactivated" records. My datasources filter these out.
0
Comment
Question by:jdcollins21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 36493411
I hope you are selecting data for the dropdown list from database using SP/query. However you include the WHERE deactivated=0 condition in that.
Now you would get only active items.
0
 

Author Closing Comment

by:jdcollins21
ID: 36494564
Thanks for your help. I woke up this morning with a similar idea. It works!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question