Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 31st, 2007, 06:56 AM
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invalid Selected Value

Hi

I'm hoping someone will be able to point me in the right direction.

I have a details view which pull information out of an sql database which a user can then update. All this is working fine, however now comes the bit I'm having difficulty with. Within the details view is a drop down list with a list of team names. Through a separate gridview a user can either update these team names or if the team is no longer part of the company it can be made in-active. If it has been made inactive that team is removed as an option from the drop down list.

Now what happens is if the team name has been made inactive and a user tries to edit a record via the details view with that team name associated with it I get the error TeamNameDropDownList has a SelectedValue which is invalid because it does not exist in the list of items. I understand why I'm getting this error, because the team name is no longer in the list of options but how do I get around it? I'm thinking of maybe some sort of if statement but not sure where to start?

Any help would be mucho appreciated

Thanks
  #2 (permalink)  
Old October 31st, 2007, 07:43 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

well.. I can see a little flaw in your logic (IMHO), why can you inactive a team name that has related records active??

I thinking 2 solutions, one is to avoid putting inactive something that should be active (or that records are something like orphans??) the second is to move the childs records to another team.

what happends if I want to change the other info of the record (not the team name), but the team name is inactive???

I think that you have another kind of problem here...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #3 (permalink)  
Old November 5th, 2007, 02:48 AM
Authorized User
 
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear RubyRue,
Try to bind the details view and the drop down list in the details view when ever you update a record in the gridview of the teams.

I hope this would help you.

Asmaa,

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
% is an invalid character? owoade .NET Web Services 1 August 12th, 2007 12:32 PM
Invalid Object Name busybee ASP.NET 1.0 and 1.1 Professional 1 July 5th, 2006 11:13 PM
Invalid ServicedComponent jdang67 C# 2005 0 February 10th, 2006 12:36 PM
syntax error on <option selected="selected"> hamid HTML Code Clinic 1 October 13th, 2004 09:20 AM



All times are GMT -4. The time now is 04:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.