Server Error in '/' Application.

Arithmetic operation resulted in an overflow.

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.OverflowException: Arithmetic operation resulted in an overflow.

Source Error:


Line 109:            int firstPageIndex = Math.Max((CurrentPage - 1) / PageButtonsCount * PageButtonsCount, 1);
Line 110:            int lastPageIndex = Math.Min(firstPageIndex + PageButtonsCount + 1, PageCount);
Line 111:            int[] pages = new int[lastPageIndex - firstPageIndex + 1];
Line 112:
Line 113:            for (int i = 0; i < pages.Length; i++)

Source File: c:\sites\sites2010\gedera.mpage.co.il\wwwroot\Common\Pager.ascx.cs    Line: 111

Stack Trace:


[OverflowException: Arithmetic operation resulted in an overflow.]
   Common_Pager.OnDataBinding(EventArgs e) in c:\sites\sites2010\gedera.mpage.co.il\wwwroot\Common\Pager.ascx.cs:111
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +304
   System.Web.UI.Control.DataBindChildren() +12659735
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   System.Web.UI.Control.DataBindChildren() +12659735
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   System.Web.UI.Control.DataBindChildren() +12659735
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   System.Web.UI.Control.DataBindChildren() +12659735
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   System.Web.UI.Control.DataBindChildren() +12659735
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   Index3._Default1.Page_Load(Object sender, EventArgs e) in c:\sites\sites2010\gedera.mpage.co.il\wwwroot\Index3\Default.aspx.cs:72
   BasePage.OnLoad(EventArgs e) +258
   SitePage.OnLoad(EventArgs e) +83
   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.17929