Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specified argument was out of the range of valid values. Parameter nam

Status
Not open for further replies.

napoleao

IS-IT--Management
Feb 20, 2002
172
PT
We are receving this error when trying to access an area of our program. Anyone know what is creating this error?

Specified argument was out of the range of valid values. Parameter name: 2010
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: 2010

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: 2010]
System.Web.UI.WebControls.ListControl.set_SelectedValue(String value) +152
MLGI.Mapas.fillDdPromAno() +197
MLGI.Mapas.Page_Load(Object sender, EventArgs e) +730
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


 
The exception is happening when you are attempting to set a value by it's index. It is possible two things are happening:

The index you are attepting to set is larger that the list populated in the control

The index you are attempting to set is happening before the control gets it's data back into it after server post back.


Example:

myDropDown.Items.Add("my item 1");
myDropDown.Items.Add("my item 2");
myDropDown.Items.Add("my item 3");
myDropDown.Items.Add("my item 4");
myDropDown.Items.Add("my item 5");

myDropDown.SelectedIndex = 6;

OUT OF RANGE
=====================================
myDropDown.SelectedIndex = 6;

PopulateDropDown(myDropDown.Items);

OUT OF RANGE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top