See, I have a problem. I have configured my file "BundleConfig.cs" to minify my styles and scripts in production. At this moment I am in the development environment. My application had some performance problems by the dependencies. At first I had pages and called unnecessary resources, such as style sheets and / or scripts, now I am correcting that. In this stage, I have had a problem that I can not miss since a day ago. My Customers page (list of them) is having problems loading, which does not happen with my Dashboard; obviously they use the same Layout (Master Page). I think it's something about my call to JQUERY but I still do not get the answer. My project is made with ASP .NET MVC 5 and I use Visual Studio 2015. It would be great if they helped me. Thank you very much.
BundleConfig.cs
using System.Web;
using System.Web.Optimization;
namespace Acisac
{
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
/* ----------------------------------- CSS ------------------------------------------ */
StyleBundle bootstrapCSS = new StyleBundle("~/css/bootstrap");
bootstrapCSS.Include("~/Content/bootstrap.min.css");
//bootstrapCSS.Include("~/Content/template/tether/tether.min.css");
StyleBundle mainCSS = new StyleBundle("~/css/mainCSS");
mainCSS.Include("~/fonts/css.css");
mainCSS.Include("~/Content/template/main.css");
//mainCSS.Include("~/Content/template/animate.min.css");
StyleBundle fontsCSS = new StyleBundle("~/css/fonts");
fontsCSS.Include(
"~/fonts/css.css",
"~/fonts/font-awesome-icons.min.css",
"~/fonts/ionicons-icons.min.css",
"~/fonts/material-design-iconic-font.min.css",
"~/fonts/other-fonts.css"
);
StyleBundle materiagrisCSS = new StyleBundle("~/css/materiagris");
materiagrisCSS.Include("~/Content/materiagris/materia03.css");
materiagrisCSS.Include("~/Content/materiagris/materia1.css");
materiagrisCSS.Include("~/Content/materiagris/materia02.css");
StyleBundle chartsCSS = new StyleBundle("~/css/charts");
chartsCSS.Include("~/Content/template/charts/chartist.min.css");
StyleBundle footableCSS = new StyleBundle("~/css/footable");
footableCSS.Include("~/Util/footable/footable.bootstrap.min.css");
bundles.Add(fontsCSS);
bundles.Add(bootstrapCSS);
bundles.Add(materiagrisCSS);
bundles.Add(mainCSS);
bundles.Add(chartsCSS);
bundles.Add(footableCSS);
/* ----------------------------------- JS scripts ------------------------------------------ */
/***************************************JQUERY***************************************/
ScriptBundle jqueryJS = new ScriptBundle("~/js/jquery");
jqueryJS.Include("~/Scripts/jquery.min.js");
/***************************************BOOTSTRAP***************************************/
ScriptBundle bootstrapJS = new ScriptBundle("~/js/bootstrap");
bootstrapJS.Include("~/Scripts/template/pluginsGenerales/tether.min.js");
bootstrapJS.Include("~/Scripts/bootstrap.min.js");
/***************************GENERALES PARA TODA LA APLICACIÓN***************************/
ScriptBundle mainJS = new ScriptBundle("~/js/mainJS");
mainJS.Include("~/Scripts/template/pluginsGenerales/jquery.storageapi.min.js");
mainJS.Include("~/Scripts/template/pluginsGenerales/jquery.fullscreen.min.js");
mainJS.Include("~/Scripts/template/pluginsGenerales/pace.min.js");
mainJS.Include("~/Scripts/template/pluginsGenerales/wow.min.js");
mainJS.Include("~/Scripts/template/scriptsGenerales/main.js");
mainJS.Include("~/Scripts/template/scriptsGenerales/colors.js");
mainJS.Include("~/Scripts/template/scriptsGenerales/functions.js");
mainJS.Include("~/Scripts/template/scriptsGenerales/left-sidebar.js");
mainJS.Include("~/Scripts/template/scriptsGenerales/navbar.js");
mainJS.Include("~/Scripts/materiagris/materiagris1/comboBoxes.js");
mainJS.Include("~/Scripts/materiagris/materiagris2/Validacion.js");
/***********************************CASOS ESPECÍFICOS***********************************/
//GRAFICOS
ScriptBundle chartsJS = new ScriptBundle("~/js/charts");
chartsJS.Include(
"~/Scripts/template/charts/Chart.min.js",
"~/Scripts/template/charts/chartist.min.js",
"~/Scripts/template/charts/charts-chartist.js",
"~/Scripts/template/charts/jquery.easypiechart.min.js",
"~/Scripts/template/charts/lodash.min.js"
);
//FOOTABLE
ScriptBundle footableJS = new ScriptBundle("~/js/footable");
footableJS.Include("~/Util/footable/footable.min.js");
footableJS.Include("~/Util/utilitarios.js");
/****************************************LOGIN****************************************/
ScriptBundle loginJS = new ScriptBundle("~/js/login");
loginJS.IncludeDirectory("~/Scripts/template/login", "*.js");
/**************************************DASHBOARD**************************************/
ScriptBundle dashboardJS = new ScriptBundle("~/js/dashboard");
dashboardJS.Include("~/Scripts/materiagris/materiagris4/diagramaBarras.js");
dashboardJS.Include("~/Scripts/materiagris/materiagris4/crudInicio.js");
/***************************************VENTAS***************************************/
ScriptBundle cotizacionJS = new ScriptBundle("~/js/cotizacion");
cotizacionJS.Include("~/Scripts/materiagris/materiagris2/ConsultasAjax.js");
ScriptBundle ordenVentaJS = new ScriptBundle("~/js/ordenVenta");
ordenVentaJS.Include("~/Scripts/materiagris/materiagris2/ConsultasAjax.js");
ordenVentaJS.Include("~/Scripts/materiagris/materiagris2/crudOrdenVenta.js");
ScriptBundle facturacionJS = new ScriptBundle("~/js/facturacion");
facturacionJS.Include("~/Scripts/materiagris/materiagris1/crudFacturacion.js");
//ScriptBundle guiaVentasJS = new ScriptBundle("~/js/guiaVentas");
//guiaVentasJS.Include("~/Scripts/materiagris/materiagris[#]/crudGuia.js");
/**************************************ALMACEN**************************************/
ScriptBundle guiaAlmacenJS = new ScriptBundle("~/js/guiaAlmacen");
guiaAlmacenJS.Include("~/Scripts/materiagris/materiagris3/crudGuia.js");
//ScriptBundle productoAlmacenJS = new ScriptBundle("~/js/productoAlmacen");
//productoAlmacenJS.Include("~/Scripts/materiagris/materiagris[#]/crudProductoAlmacen.js");
ScriptBundle notaIngresoJS = new ScriptBundle("~/js/notaIngreso");
notaIngresoJS.Include("~/Scripts/materiagris/materiagris3/crudNotaIngreso.js");
ScriptBundle notaSalidaJS = new ScriptBundle("~/js/notaSalida");
notaSalidaJS.Include("~/Scripts/materiagris/materiagris3/crudNotaSalida.js");
/**************************************COMPRAS**************************************/
//ScriptBundle ordenCompraJS = new ScriptBundle("~/js/ordenCompra");
//ordenCompraJS.Include("~/Scripts/materiagris/materiagris[#]/crudOrdenCompra.js");
/**************************************CUENTAS**************************************/
ScriptBundle reciboJS = new ScriptBundle("~/js/recibo");
reciboJS.Include("~/Scripts/materiagris/materiagris1/crudRecibo.js");
ScriptBundle convenioJS = new ScriptBundle("~/js/convenio");
convenioJS.Include("~/Scripts/materiagris/materiagris2/agregarConvenio.js");
//convenioJS.Include("~/Scripts/materiagris/materiagris[#]/crudConvenio.js");
/***********************************MANTENIMIENTO***********************************/
ScriptBundle clienteJS = new ScriptBundle("~/js/cliente");
clienteJS.Include("~/Scripts/materiagris/materiagris1/crudCliente.js");
clienteJS.Include("~/Scripts/materiagris/materiagris2/ContactoNuevo.js");
clienteJS.Include("~/Scripts/materiagris/materiagris2/DireccionNuevo.js");
ScriptBundle proveedorJS = new ScriptBundle("~/js/proveedor");
proveedorJS.Include("~/Scripts/materiagris/materiagris3/crudProveedor.js");
ScriptBundle empleadoJS = new ScriptBundle("~/js/empleado");
empleadoJS.Include("~/Scripts/materiagris/materiagris4/crudEmpleado.js");
ScriptBundle almacenJS = new ScriptBundle("~/js/almacen");
almacenJS.Include("~/Scripts/materiagris/materiagris1/crudAlmacen.js");
ScriptBundle anaquelJS = new ScriptBundle("~/js/anaquel");
anaquelJS.Include("~/Scripts/materiagris/materiagris1/crudAnaquel.js");
ScriptBundle familiaJS = new ScriptBundle("~/js/familia");
familiaJS.Include("~/Scripts/materiagris/materiagris3/crudFamilia.js");
ScriptBundle productoMantenimientoJS = new ScriptBundle("~/js/productoMantenimiento");
productoMantenimientoJS.Include("~/Scripts/materiagris/materiagris1/crudProducto.js");
clienteJS.Include("~/Scripts/materiagris/materiagris2/AgregarCaracteristica.js");
ScriptBundle marcaJS = new ScriptBundle("~/js/marca");
marcaJS.Include("~/Scripts/materiagris/materiagris3/crudFamilia.js");
ScriptBundle unidadJS = new ScriptBundle("~/js/unidad");
unidadJS.Include("~/Scripts/materiagris/materiagris1/crudUnidad.js");
ScriptBundle cambioJS = new ScriptBundle("~/js/cambio");
cambioJS.Include("~/Scripts/materiagris/materiagris1/crudTipocambio.js");
ScriptBundle impuestoJS = new ScriptBundle("~/js/impuesto");
impuestoJS.Include("~/Scripts/materiagris/materiagris3/crudFamilia.js");
/***********************************TRANSPORTE***********************************/
ScriptBundle etransporteJS = new ScriptBundle("~/js/etransporte");
etransporteJS.Include("~/Scripts/materiagris/materiagris1/crudEmpresaTransporte.js");
//ScriptBundle vehiculoJS = new ScriptBundle("~/js/vehiculo");
//vehiculoJS.Include("~/Scripts/materiagris/materiagris[#]/crudVehiculo.js");
//ScriptBundle conductorJS = new ScriptBundle("~/js/conductor");
//conductorJS.Include("~/Scripts/materiagris/materiagris[#]/crudConductor.js");
/***********************************REPORTES***********************************/
//ScriptBundle reporteJS = new ScriptBundle("~/js/reporte");
//reporteJS.Include("~/Scripts/materiagris/materiagris[#]/crudReporte.js");
/********************************G. DE USUARIOS********************************/
//ScriptBundle perfilJS = new ScriptBundle("~/js/perfil");
//perfilJS.Include("~/Scripts/materiagris/materiagris[#]/crudPerfil.js");
//ScriptBundle usuarioJS = new ScriptBundle("~/js/usuario");
//usuarioJS.Include("~/Scripts/materiagris/materiagris[#]/crudUsuario.js");
/***********************************CONFIGURACION***********************************/
//ScriptBundle empresaJS = new ScriptBundle("~/js/empresa");
//empresaJS.Include("~/Scripts/materiagris/materiagris[#]/crudEmpresa.js");
//ScriptBundle serieJS = new ScriptBundle("~/js/serie");
//serieJS.Include("~/Scripts/materiagris/materiagris[#]/crudSerie.js");
//ScriptBundle bancoJS = new ScriptBundle("~/js/banco");
//bancoJS.Include("~/Scripts/materiagris/materiagris[#]/crudBanco.js");
bundles.Add(jqueryJS);
bundles.Add(bootstrapJS);
bundles.Add(mainJS);
bundles.Add(chartsJS);
bundles.Add(footableJS);
bundles.Add(loginJS);
bundles.Add(dashboardJS);
bundles.Add(cotizacionJS);
bundles.Add(ordenVentaJS);
bundles.Add(facturacionJS);
//bundles.Add(guiaVentasJS);
bundles.Add(guiaAlmacenJS);
//bundles.Add(productoAlmacenJS);
bundles.Add(notaIngresoJS);
bundles.Add(notaSalidaJS);
//bundles.Add(ordenCompraJS);
bundles.Add(reciboJS);
bundles.Add(convenioJS);
bundles.Add(clienteJS);
bundles.Add(proveedorJS);
bundles.Add(empleadoJS);
bundles.Add(almacenJS);
bundles.Add(anaquelJS);
bundles.Add(familiaJS);
bundles.Add(productoMantenimientoJS);
bundles.Add(marcaJS);
bundles.Add(unidadJS);
bundles.Add(cambioJS);
bundles.Add(impuestoJS);
bundles.Add(etransporteJS);
//bundles.Add(vehiculoJS);
//bundles.Add(conductorJS);
//bundles.Add(reporteJS);
//bundles.Add(perfilJS);
//bundles.Add(usuarioJS);
//bundles.Add(empresaJS);
//bundles.Add(serieJS);
//bundles.Add(bancoJS);
}
}
}
_Layout.cshtml
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ACISAC - @ViewBag.Title</title>
<link rel="icon" href="~/Assets/icon/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="~/Assets/icon/favicon.ico" type="image/x-icon">
<!-- CSS -->
@Styles.Render("~/css/fonts")
@Styles.Render("~/css/bootstrap")
@Styles.Render("~/css/mainCSS")
@Styles.Render("~/css/materiagris")
<!-- ------ -->
<!-- SCRIPTS -->
@Scripts.Render("~/js/jquery")
@Scripts.Render("~/js/bootstrap")
@Scripts.Render("~/js/mainJS")
<!-- ------ -->
</head>
<body data-layout="empty-layout" data-palette="palette-6" data-direction="none">
<div class="main">
<!--header-->
@Html.Partial("_header")
<div class="clearfix"></div>
<!--content-->
@RenderBody()
<div class="clearfix"></div>
<!--footer-->
@Html.Partial("_footer")
</div>
</body>
</html>
Dashboard.cshtml
-controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AcisacWeb.CrossCutting.Dominio.Entidades;
using AcisacWeb.Web.Core.Mantenimiento;
using AcisacWeb.Web.Core.Inicio;
using Acisac.Helper;
using Acisac.Tags;
namespace Acisac.Controllers
{
public class InicioController : Controller
{
string username = Helper.SessionHelper.getUsernameUser();
TipocambioCore TipocambioCore = new TipocambioCore();
UsuarioCore UsuarioCore = new UsuarioCore();
[Autenticado]
public ActionResult Dashboard()
{
TIPO_CAMBIO TIPO_CAMBIO = new TIPO_CAMBIO();
TIPO_CAMBIO.NESTADO = TipocambioCore.ObtenerEstado("2")[0].NESTADO;
return View(TIPO_CAMBIO);
//return View();
}
}
}
-view:
@model AcisacWeb.CrossCutting.Dominio.Entidades.TIPO_CAMBIO
@{
ViewBag.Title = "Dashboard";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Styles.Render("~/css/charts")
<!--fila de 4 paneles-->
<div class="row">
...
</div>
<script>
function CargaModal() {
tipoCambio = '@Model.NESTADO';
if (tipoCambio == 0) {
$('#myModal').modal('show');
}
};
</script>
@Scripts.Render("~/js/charts")
@Scripts.Render("~/js/dashboard")
Clients.cshtml
-controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AcisacWeb.CrossCutting.Dominio.Entidades;
using AcisacWeb.Web.Core.Mantenimiento;
using Acisac.Tags;
using AcisacWeb.CrossCutting.Dominio.ViewModels;
namespace Acisac.Controllers
{
[Autenticado]
public class MantenimientoController : Controller
{
string username = Helper.SessionHelper.getUsernameUser();
AlmacenCore AlmacenCore = new AlmacenCore();
AnaquelCore AnaquelCore = new AnaquelCore();
FamiliaCore FamiliaCore = new FamiliaCore();
ClienteCore ClienteCore = new ClienteCore();
ContactoclienteCore ContactoclienteCore = new ContactoclienteCore();
DireccionclienteCore DireccionclienteCore = new DireccionclienteCore();
TransporteCore TransporteCore = new TransporteCore();
TipopersonaCore TipopersonaCore = new TipopersonaCore();
ProductoCore ProductoCore = new ProductoCore();
TipocambioCore TipocambioCore = new TipocambioCore();
UnidadCore UnidadCore = new UnidadCore();
TipoproductoCore TipoproductoCore = new TipoproductoCore();
TipomonedaCore TipomonedaCore = new TipomonedaCore();
TipodocumentopersonaCore TipodocumentopersonaCore = new TipodocumentopersonaCore();
TipodireccionCore TipodireccionCore = new TipodireccionCore();
ProveedorCore ProveedorCore = new ProveedorCore();
MarcaCore MarcaCore = new MarcaCore();
ImpuestoCore ImpuestoCore = new ImpuestoCore();
PaisCore PaisCore = new PaisCore();
EmpleadoCore EmpleadoCore = new EmpleadoCore();
UbigeoCore UbigeoCore = new UbigeoCore();
CaracteristicaCore CaracteristicaCore = new CaracteristicaCore();
ProveedorDatosBancariosCore ProveedorDatosBancariosCore = new ProveedorDatosBancariosCore();
ProveedorContactoCore ProveedorContactoCore = new ProveedorContactoCore();
ProveedorDireccionesCore ProveedorDireccionesCore = new ProveedorDireccionesCore();
SedesCore SedesCore = new SedesCore();
AreasCore AreasCore = new AreasCore();
CargosCore CargosCore = new CargosCore();
public ActionResult Clientes(string PDFINICIO, string PDFFIN)
{
List<CLIENTE> clientes = new List<CLIENTE>();
if (String.IsNullOrEmpty(PDFINICIO) && String.IsNullOrEmpty(PDFFIN))
{
clientes = ClienteCore.Listar();
return View(clientes);
}
if (!(String.IsNullOrEmpty(PDFINICIO)) && !(String.IsNullOrEmpty(PDFFIN)))
{
clientes = ClienteCore.Filtrar(Convert.ToDateTime(PDFINICIO), Convert.ToDateTime(PDFFIN));
return View(clientes);
}
if (String.IsNullOrEmpty(PDFINICIO) || String.IsNullOrEmpty(PDFFIN))
{
if (String.IsNullOrEmpty(PDFINICIO))
{
PDFINICIO = DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd");
clientes = ClienteCore.Filtrar(Convert.ToDateTime(PDFINICIO), Convert.ToDateTime(PDFFIN));
return View(clientes);
}
else
{
PDFFIN = DateTime.Now.ToString("yyyy-MM-dd");
clientes = ClienteCore.Filtrar(Convert.ToDateTime(PDFINICIO), Convert.ToDateTime(PDFFIN));
return View(clientes);
}
}
else
{
return View(clientes);
}
}
}
}
-view:
@model IEnumerable<AcisacWeb.CrossCutting.Dominio.Entidades.CLIENTE>
@{
ViewBag.Title = "Clientes";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="row-lg col-md-12">
<!--cabecera-->
<div class="row">
<h3 class="color-default">Clientes</h3>
<hr />
</div>
...
</div>
<!-- </div> /.main -->
<!-- DETALLE modal -->
<div aria-hidden="true" aria-labelledby="large-modalLabel" class="modal fade" id="DETALLE_CLIENTE" role="dialog" tabindex="-1">
...
</div>
<!-- ELIMINAR modal -->
<div class="modal fade" id="ELIMINAR_CLIENTE" tabindex="-1" role="dialog" aria-labelledby="small-modalLabel" aria-hidden="true">
...
</div>
<!-- -->
@*@Scripts.Render("~/js/cliente")*@
NOTE I have noticed that when I open the source code of the page and I remove a style, my page appears, but disorderly. So: