Server Error in '/' Application.

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

Source Error:


Line 145:		SelectMonth.SelectedIndex=month(pViewDay)-1
Line 146:		SelectDay.SelectedIndex = day(pViewDay)-1
Line 147:		SelectYear.SelectedIndex = year(pViewDay)-year(Today)+3
Line 148:
Line 149:	else

Source File: E:\web\schoolwebda\htdocs\UnityWI\CalendarPage.aspx    Line: 147

Stack Trace:


[ArgumentOutOfRangeException: 'SelectYear' has a SelectedIndex which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.set_SelectedIndex(Int32 value) +336
   System.Web.UI.WebControls.DropDownList.set_SelectedIndex(Int32 value) +5
   ASP.unitywi_calendarpage_aspx.Page_Load(Object sender, EventArgs e) in E:\web\schoolwebda\htdocs\UnityWI\CalendarPage.aspx:147
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2850


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