Server Error in '/' Application.

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

Source Error:


Line 258:        ddlProducer.Items.Clear()
Line 259:        ddlProducer.Items.Add(New ListItem("Please select...", ""))
Line 260:        ddlProducer.DataBind()
Line 261:        ddlProducer.SelectedValue = theProducer
Line 262:

Source File: D:\ehrmannswines.co.uk\TierMaster.master.vb    Line: 260

Stack Trace:


[ArgumentOutOfRangeException: 'ddlProducer' 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) +2693966
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +290
   System.Web.UI.WebControls.ListControl.PerformSelect() +37
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   TierMaster.refreshDropDowns() in D:\ehrmannswines.co.uk\TierMaster.master.vb:260
   TierMaster.Page_Load(Object sender, EventArgs e) in D:\ehrmannswines.co.uk\TierMaster.master.vb:78
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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