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 1193:            string retVal = "";
Line 1194:            _SelectedRoom.ForEach(x => retVal += x.ToString() + ",");
Line 1195:            return retVal.Substring(0, retVal.Length - 1);
Line 1196:            //return string.Join(",", _SelectedRoom.ToArray()); 
Line 1197:        }

Source File: c:\sites\poni38.ru\App_Code\Realty\ObjectsFilter.cs    Line: 1195

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +14496954
   ObjectsFilter.get_SelectedRoomStr() in c:\sites\poni38.ru\App_Code\Realty\ObjectsFilter.cs:1195
   ObjectsFilter.get_QueryString() in c:\sites\poni38.ru\App_Code\Realty\ObjectsFilter.cs:866
   public_Default.bindData(ObjectsFilter aFilter) in c:\sites\poni38.ru\public\Default.aspx.cs:211
   public_Default.Page_Load(Object sender, EventArgs e) in c:\sites\poni38.ru\public\Default.aspx.cs:25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178


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