473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dropdown

Howdy,

I'm getting an error and I'm not sure why:

System.ArgumentOutOfRangeException: 'ddManufacturer' has a SelectedValue
which is invalid because it does not exist in the list of items. Parameter
name: value at
System.Web.UI.WebControls.ListControl.PerformDataB inding(IEnumerable
dataSource) at System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs
e) at System.Web.UI.WebControls.ListControl.PerformSelec t() at
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() at

This is occuring in the Page_PreRender event of a custom user control. The
actual value isn't set to the drop down until the Page_Load Event so why the
error?

I received the same error with another dropdown list on another page but was
not being fired on either Page event. To correct it, I put the
ddItems.SelectedValue = "test" BEFORE the line to load the dropdown and that
resolved it. Why? Am I missing something?

Thanks a ton

Merry Christmas
David Lozzi
Dec 8 '06 #1
1 1627
Can you post some code?

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc

"David Lozzi" <dl****@nospam.nospamwrote in message
news:Ok****************@TK2MSFTNGP06.phx.gbl...
Howdy,

I'm getting an error and I'm not sure why:

System.ArgumentOutOfRangeException: 'ddManufacturer' has a SelectedValue
which is invalid because it does not exist in the list of items. Parameter
name: value at
System.Web.UI.WebControls.ListControl.PerformDataB inding(IEnumerable
dataSource) at
System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e) at
System.Web.UI.WebControls.ListControl.PerformSelec t() at
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() at

This is occuring in the Page_PreRender event of a custom user control. The
actual value isn't set to the drop down until the Page_Load Event so why
the error?

I received the same error with another dropdown list on another page but
was not being fired on either Page event. To correct it, I put the
ddItems.SelectedValue = "test" BEFORE the line to load the dropdown and
that resolved it. Why? Am I missing something?

Thanks a ton

Merry Christmas
David Lozzi

Dec 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8254
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
0
2568
by: Toonman | last post by:
I have a webpage with a <form> consisting of a large table grid of dropdown lists used to make changes in a database. Some of these dropdown lists have the same value. I'm trying to make it so...
6
7348
by: Rey | last post by:
Howdy, all. Appreciate your help. Have a one to many relation between a client and visit table. In the visit subform, I have a visittype and counselor field which are comboboxes. If I set...
13
2854
by: melih.onvural | last post by:
Group, I'm having a tough time understanding some of the previous posts on this topic so I wanted to write what I've tried and hope that you can help me troubleshoot. I have a dropdown populated...
2
3047
by: 23s | last post by:
I have a dropdown bound to a dataview. The binding assigns the dropdown with a SelectedIndex of 0. There is a msgbox in the SelectedIndexChanged event that displays the SelectedIndex property....
5
10276
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
3
1978
by: CSharpguy | last post by:
I'm trying to populate a drop down with dates from a data field in my data base but I want the format like MM/dd/yyyy instead of 1/1/2006 12:00 PM How can I my date to show as 1/1/2006? I'm...
3
4412
by: devNorway | last post by:
I have been struggling with a problem for days now, and searched for related problems and solutions but had no luck. I have two dropdown listboxes where the first is populated in page load and...
0
1335
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
1600
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.