Server Error in '/' Application.

'minValue' cannot be greater than maxValue.
Parameter name: minValue

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: 'minValue' cannot be greater than maxValue.
Parameter name: minValue

Source Error:


Line 184:        for (int i = 0; i < 6; i++)
Line 185:        {
Line 186:            int row = _rdm.Next(_min, _max);
Line 187:            selectedCars.Add(cars[row]);
Line 188:        }

Source File: c:\inetpub\vhosts\carmizan.com\httpdocs\Car\Car.aspx.cs    Line: 186

Stack Trace:


[ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue]
   System.Random.Next(Int32 minValue, Int32 maxValue) +14597260
   Car_ShowCar.LoadSimilarCars() in c:\inetpub\vhosts\carmizan.com\httpdocs\Car\Car.aspx.cs:186
   Car_ShowCar.LoadCarDetails() in c:\inetpub\vhosts\carmizan.com\httpdocs\Car\Car.aspx.cs:156
   Car_ShowCar.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\carmizan.com\httpdocs\Car\Car.aspx.cs:98
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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