Server Error in '/' Application.

'dlSeries' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

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: 'dlSeries' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

Source Error:


Line 325:        dlSeries.DataTextField = "TerminalSeriesName";
Line 326:        dlSeries.DataValueField = "TerminalSeriesId";
Line 327:        dlSeries.DataBind();
Line 328:        dlSeries.Items.Insert(0, new ListItem("- Select -"));
Line 329:    }

Source File: c:\inetpub\vhosts\elmex.net\httpdocs\series.aspx.cs    Line: 327

Stack Trace:


[ArgumentOutOfRangeException: 'dlSeries' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) +1324
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +384
   System.Web.UI.WebControls.ListControl.PerformSelect() +43
   series.binddlSeries(Int32 catid) in c:\inetpub\vhosts\elmex.net\httpdocs\series.aspx.cs:327
   series.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\elmex.net\httpdocs\series.aspx.cs:211
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3930.0