Solved

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

Posted on 2011-09-06
2
268 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
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now