protected void btnAgregar_Click(object sender, EventArgs e) { clsGastos Pedido = new clsGastos(); if (Session["objDGastos"] != null) { Pedido = (clsGastos)Session["objDGastos"]; } string Descripcion = Convert.ToString(txtDescripcion.Text); Decimal Monto = Decimal.Parse(txtMonto.Text); Pedido.AgregarDetalle(Descripcion, Monto); System.Nullable<Decimal> tot = 0; tot = (from i in Pedido.Items select i.Monto).Sum(); Pedido.Total = Convert.ToDecimal(tot); Session["objDGastos"] = Pedido; Agregar(); }