Server Error in '/' Application.

Attempted to divide by zero.

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.DivideByZeroException: Attempted to divide by zero.

Source Error:


Line 166:                int weekClassesTime = hoursPerWeek;
Line 167:
Line 168:                if (courseTotalTime % weekClassesTime > 0)
Line 169:                    classWeekLong = courseTotalTime / weekClassesTime + 1;
Line 170:                else

Source File: c:\inetpub\vhosts\programmershouse.ir\httpdocs\Prints\SpecialCourses.aspx.cs    Line: 168

Stack Trace:


[DivideByZeroException: Attempted to divide by zero.]
   ControlPanel_StudentPanel_Prints_RegisterStudent.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\programmershouse.ir\httpdocs\Prints\SpecialCourses.aspx.cs:168
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1601


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