Server Error in '/' Application.

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

Source Error:


Line 49:             {
Line 50:                 ddlProduct.SelectedValue = Convert.ToInt32(Request.QueryString["id"].ToString()).ToString();
Line 51:                 ddlProduct.DataBind();
Line 52:             }
Line 53:         }

Source File: c:\inetpub\vhosts\iotcco.com\httpdocs\products\form\Default.aspx.cs    Line: 51

Stack Trace:


[ArgumentOutOfRangeException: 'ddlProduct' 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
   products_form_Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\iotcco.com\httpdocs\products\form\Default.aspx.cs:51
   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.3770.0