Server Error in '/' Application.

Length cannot be less than zero.
Parameter name: length

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: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 142:            string postMonth = Request.QueryString["messagemonth"].ToString();
Line 143:            int pos = postMonth.IndexOf(" ");
Line 144:            string mon = postMonth.Substring(0, pos);
Line 145:            int yr = Convert.ToInt32(postMonth.Substring(pos + 1));
Line 146:            int mn = DateTime.ParseExact(mon, "MMMM", CultureInfo.CurrentCulture).Month;

Source File: c:\Websites\chunati\chunati.com\webroot\illustriousperson\illustriousperson.aspx.cs    Line: 144

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14342605
   illustriousperson_illustriousperson.BindIllustriousPerson() in c:\Websites\chunati\chunati.com\webroot\illustriousperson\illustriousperson.aspx.cs:144
   illustriousperson_illustriousperson.Page_Load(Object sender, EventArgs e) in c:\Websites\chunati\chunati.com\webroot\illustriousperson\illustriousperson.aspx.cs:22
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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