Server Error in '/' Application.

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

Source Error:


Line 20:             docName.DataTextField = "fldStaffName"
Line 21:             docName.DataValueField = "fldStaffID"  'id used for list,but for this case use same column name as per datatextfield
Line 22:             docName.DataBind()
Line 23:             docName.Items.Insert(0, New ListItem("Doctor Name", "0"))
Line 24:             'If namedoc = "" Then

Source File: E:\UCSI-Web-CS\ucsihospital-com\contact.aspx.vb    Line: 22

Stack Trace:


[ArgumentOutOfRangeException: 'docName' 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) +2751856
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +303
   System.Web.UI.WebControls.ListControl.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   contact.Page_Load(Object sender, EventArgs e) in E:\UCSI-Web-CS\ucsihospital-com\contact.aspx.vb:22
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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