Error in call to base.OnPreRender(e) in ApplicationBasepage.cs


Author
Message
Marcia G Akins
Marcia G Akins
StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

I am working my little heart out on a prototype using the web sample app. I have the search page up and running and am working on the edit page. After I clcik on Undo, I get this error:

[ArgumentOutOfRangeException: 'ddlOwner' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.set_SelectedValue(String value) +8548181


Now, I understand what the error means. However, I also have a drop down list that contains owners from the users table. On the seach page, the owner shows up in the listview with a value that is theoretically in the users table (Anyway, it looks that way when I look at the data in SQL Server). When the Edit page comes up, the slected value in the owners drop down list is blank, even though I can see the correct value in the control's list.

I have a similar problem with some other drop down lists on this page - same sort of error, same line of code. However, these drop down lists show up with the correct selected value when I first navigate to the edit page.

Any idea on what is going on here? I have a feeling that it must be something simple, but I haven't done much web programming and could really use some help.

TIA.

-- Marcia
Marcia G Akins
Marcia G Akins
StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

OK - I have some additional information. I thought that this might be a data issue and I resolved most of my error issues that were being caused by null values. The only one that remains is the one where I can see the owner in the table in SQL Server - it is not null, it shows up in the ListView on the search screen, but when I click the edit link, the owner does not show up in the drop down list on the edit page even though when I drop the list I can see the correect owner in it.

One this line:

base.OnPreRender(e);

It gives me this error:

[ArgumentOutOfRangeException: 'ddlOwner' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.set_SelectedValue(String value) +8548181


Furthermore, the problem occurs only on specific records in the users table, so I think that it still may be data, but I have no clue what the problem might be because this one has nothing to do with null values. The field in the users table and the field in the table I am storing the user_id in are both defined as VARCHAR(10). Can someone point me in the right direction, please?

Thanks!

-- Marcia

 


Marcia G Akins
Marcia G Akins
StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
OK - here I am talking to myself again Smile

I tracked down the error in the users table to the fact that some of the user IDs in the users table have trailing spaces but the user_id in the table that contains the binding field does not. Is there any programmatic way to resolve this?

And what about similar errors caused by the fact that the value of the field in the lookup table is stored in upper case by the value in the table being updated is in lower case?

TIA

-- Marcia
Edited 13 Years Ago by Marcia G Akins
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Marcia.

In the past, on some lookup type tables, I was getting inconsistent results if I had a table with a VarChar. If I chenge it to Char , seemd to fix it, I assum it was something in the VarChar to do with trailing spaces. It might be worth a try

Regards,

Gerard
Marcia G Akins
Marcia G Akins
StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)StrataFrame User (432 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Gerard O Carroll (10/28/2011)
In the past, on some lookup type tables, I was getting inconsistent results if I had a table with a VarChar. If I chenge it to Char , seemd to fix it, I assum it was something in the VarChar to do with trailing spaces. It might be worth a try


Thanks for trying to help. That problem was solved a few hours agao. I was just wondering if there was an easy was to populate the drop down lists so that they would automagically right trim the items and act like they were case insensitive.

If there is no EASY way, I am not really interested Smile

Have a great weekend!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search