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 1623:        Soportes += "<div class='CajasSop' style='width:23%;'><span class='CajaSopNombre'>" + Nombre + "</div>";
Line 1624:        Soportes += "<div class='CajasSop' style='width:22%'><span id='" + TiRe + "Val" + n + "' class='CajaSopNumber'>" + Resis.ToString("N4") + "</span></div>";
Line 1625:        Decimal Dif = ((100 - (Resis * 100) / Valor.Ultimo) * -1); //Rentabilidad
Line 1626:        Soportes += "<div class='CajasSop' style='width:20%'><span id='" + TiRe + "Dif" + n + "' class='CajaSopNumber' >" + Dif.ToString("N2") + "%</span></div>";
Line 1627:        Soportes += "<div class='CajasSop' style='width:18%;color:black;'><span id='" + TiRe + "Rota" + n + "' class='CajaSopNombre' style='text-align:center;'>" + Rota + "</span></div>";

Source File: \\vid4582.nas1.lan\vid4582\Webs\Plataforma\HomeMovCLS.aspx.cs    Line: 1625

Stack Trace:


[DivideByZeroException: Attempted to divide by zero.]
   System.Decimal.FCallDivide(Decimal& d1, Decimal& d2) +0
   System.Decimal.op_Division(Decimal d1, Decimal d2) +23
   Home.RadarCreoFila(Decimal Resis, String TiRe, Int32 n) in \\vid4582.nas1.lan\vid4582\Webs\Plataforma\HomeMovCLS.aspx.cs:1625
   Home.CargoPagina() in \\vid4582.nas1.lan\vid4582\Webs\Plataforma\HomeMovCLS.aspx.cs:1134
   Home.Page_Load(Object sender, EventArgs e) in \\vid4582.nas1.lan\vid4582\Webs\Plataforma\HomeMovCLS.aspx.cs:139
   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.4087.0