Server Error in '/' Application.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:


Line 71:         int startIndex = page * resultsPerPage;
Line 72:         for (int i = startIndex; i < startIndex + resultsPerPage && i < results.Count; i++)
Line 73:             pageResults.Add(results[i]);
Line 74: 
Line 75:         return pageResults;

Source File: g:\pleskvhosts\hvallison.com\httpdocs\controls\SearchResultsControl.ascx.cs    Line: 73

Stack Trace:


[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +64
   System.ThrowHelper.ThrowArgumentOutOfRangeException() +15
   System.Collections.Generic.List`1.get_Item(Int32 index) +7715832
   controls_SearchResultsControl.GetResultsForPage(List`1 results, Int32 page) in g:\pleskvhosts\hvallison.com\httpdocs\controls\SearchResultsControl.ascx.cs:73
   controls_SearchResultsControl.DataBind() in g:\pleskvhosts\hvallison.com\httpdocs\controls\SearchResultsControl.ascx.cs:36
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   HVAllison.Exhibit.Page_Load(Object sender, EventArgs e) in g:\pleskvhosts\hvallison.com\httpdocs\Exhibit.aspx.cs:84
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062