Answered by:
I can not see modal because of error 404

Question
-
User-733224187 posted
Good Morning, I created some pages of errors and some modal by css, but this one giving error when trying to visualize the modal, instead of loading it the modal it loads a 404 error
global:using System.Web.Routing; using System.Web.Security; using System.Web.SessionState; namespace macpartner { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { CheckRolesAndSuperUser(); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); TimeHandler.Start(); } private void CheckRolesAndSuperUser() { UserHelper.CheckRole("Admin"); UserHelper.CheckRole("Analista"); UserHelper.CheckRole("Vendedor"); UserHelper.CheckRole("Parceiro"); UserHelper.CheckRole("Financeiro"); UserHelper.CheckSuperUser(); } protected void Application_Error(object sender, EventArgs e) { Exception exception = Server.GetLastError(); Response.Clear(); HttpException httpException = exception as HttpException; int error = httpException != null ? httpException.GetHttpCode() : 0; Server.ClearError(); Response.Redirect(String.Format("~/Error/?error={0}", error, exception.Message)); }
Controller erro:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using macpartner.Models; namespace macpartner.Controllers { public class ErrorController : Controller { private MacPartnerContext db = new MacPartnerContext(); // GET: Error public ActionResult Index(int error = 0) { switch (error) { case 500: ViewBag.Imagem = "https://i.imgur.com/JUtjbnQ.png"; break; case 404: ViewBag.Imagem = "https://i.imgur.com/6hW4WwF.png"; break; default: ViewBag.Imagem = "https://i.imgur.com/nBbSpyD.png"; break; } return View("~/views/error/_ErrorPage.cshtml"); } } }
controller modal:
using macpartner.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace macpartner.Controllers { public class DashboardsController : Controller { macpartner.Models.MacPartnerContext db = new Models.MacPartnerContext(); // GET: Dashboards public ActionResult Index() { ViewBag.Parceiros = db.Users.Where(u => u.Parceiro == true).ToList(); if (ViewBag.Parceiros.Count > 0) { ViewBag.ParceirosCount = ViewBag.Parceiros.Count; } else { ViewBag.ParceirosCount = 0; } ViewBag.Leads = db.Leads.ToList(); if (ViewBag.Leads.Count > 0) { ViewBag.LeadsCount = ViewBag.Leads.Count; } else { ViewBag.LeadsCount = 0; } ViewBag.LeadsConvertidos = db.Leads.Where(l => l.status == "Negócio Fechado!").ToList(); if (ViewBag.LeadsConvertidos.Count > 0) { ViewBag.LeadsConvertidosCount = ViewBag.LeadsConvertidos.Count; } else { ViewBag.LeadsConvertidosCount = 0; } ViewBag.LeadsPendentes = db.Leads.Where(l => l.status == "Pendente").ToList(); if (ViewBag.LeadsPendentes.Count > 0) { ViewBag.LeadsPendentesCount = ViewBag.LeadsPendentes.Count; } else { ViewBag.LeadsPendentesCount = 0; } ViewBag.LeadsProcesso = db.Leads.Where(l => l.status != "Pendente" && l.status != "Negócio Fechado!" && l.status != "Proposta Recusada").ToList(); if (ViewBag.LeadsProcesso.Count > 0) { ViewBag.LeadsProcessoCount = ViewBag.LeadsProcesso.Count; } else { ViewBag.LeadsProcessoCount = 0; } ViewBag.LeadsFinalizados = db.Leads.Where(l => l.status == "Negócio Fechado!" || l.status == "Proposta Recusada").ToList(); if (ViewBag.LeadsFinalizados.Count > 0) { ViewBag.LeadsFinalizadosCount = ViewBag.LeadsFinalizados.Count; } else { ViewBag.LeadsFinalizadosCount = 0; } ViewBag.Consultores = db.Users.Where(u => u.Vendedor == true).ToList(); ViewBag.DataFinalDefault = DateTime.Today.ToShortDateString(); ViewBag.DataInicialDefault = "01" + DateTime.Today.ToShortDateString().Substring(2, 8); ViewBag.DataDiaSemana = DateTime.Today.DayOfWeek; ViewBag.DataInicioSemana = ""; Dictionary<int, int> ParceirosDict = new Dictionary<int, int>(); foreach (var p in ViewBag.Parceiros) { ParceirosDict.Add(p.UserId, p.Leads.Count); } var ParceirosDictSorted = ParceirosDict.OrderByDescending(key => key.Value).ToList(); var ParceiroOuroId = ParceirosDictSorted[0].Key; var ParceiroPrataId = ParceirosDictSorted[1].Key; var ParceiroBronzeId = ParceirosDictSorted[2].Key; ViewBag.ParceiroOuroNome = db.Users.Find(ParceiroOuroId).FirstName; ViewBag.ParceiroPrataNome = db.Users.Find(ParceiroPrataId).FirstName; ViewBag.ParceiroBronzeNome = db.Users.Find(ParceiroBronzeId).FirstName; ViewBag.ParceiroOuroTotal = ParceirosDictSorted[0].Value; ViewBag.ParceiroPrataTotal = ParceirosDictSorted[1].Value; ViewBag.ParceiroBronzeTotal = ParceirosDictSorted[2].Value; return View(); } // GET: Dashboards/Details/5 public ActionResult Details(int id) { return View(); } // GET: Dashboards/Create public ActionResult Create() { return View(); } // POST: Dashboards/Create [HttpPost] public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: Dashboards/Edit/5 public ActionResult Edit(int id) { return View(); } // POST: Dashboards/Edit/5 [HttpPost] public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: Dashboards/Delete/5 public ActionResult Delete(int id) { return View(); } // POST: Dashboards/Delete/5 [HttpPost] public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here return RedirectToAction("Index"); } catch { return View(); } } public ActionResult Filtro(int consultorId, string dInicio, string dFim) { if (consultorId != 0) { //Filtrando parceiros cadastrados pelo consultor ViewBag.Parceiros = db.Users.Where(u => u.ConsultorId == consultorId).ToList(); } else { //Filtrando parceiros cadastrados pelo consultor ViewBag.Parceiros = db.Users.Where(u=> u.Parceiro == true).ToList(); } if (ViewBag.Parceiros.Count > 0) { ViewBag.ParceirosCount = ViewBag.Parceiros.Count; } else { ViewBag.ParceirosCount = 0; } //Filtrando Leads dos parceiros do consultor ViewBag.Leads = db.Leads.ToList(); List<Lead> leadsByConsultorId = new List<Lead>(); List<Lead> leadsConvertidosByConsultorId = new List<Lead>(); List<Lead> leadsProcessoByConsultorId = new List<Lead>(); List<Lead> leadsPendentesByConsultorId = new List<Lead>(); List<Lead> leadsFinalizadosByConsultorId = new List<Lead>(); foreach (var lead in ViewBag.Leads) { var parceiro = db.Users.Find(lead.UserId); //Check se o lead é da rede do consultor if ((parceiro.ConsultorId == consultorId || consultorId == 0) && (DateTime.Parse(lead.data.ToShortDateString()) >= DateTime.Parse(dInicio) && DateTime.Parse(lead.data.ToShortDateString()) <= DateTime.Parse(dFim))) { leadsByConsultorId.Add(lead); //Check se o lead foi convertido if (lead.status == "Negócio Fechado!") { leadsConvertidosByConsultorId.Add(lead); } //Check se o lead está em processo if (lead.status != "Negócio Fechado!" && lead.status != "Proposta Recusada" && lead.status != "Pendente") { leadsProcessoByConsultorId.Add(lead); } //Check se o lead está pendente if (lead.status == "Pendente") { leadsPendentesByConsultorId.Add(lead); } //Check se o lead está finalizado if (lead.status == "Negócio Fechado!" || lead.status == "Proposta Recusada") { leadsFinalizadosByConsultorId.Add(lead); } } } ViewBag.Leads = leadsByConsultorId; ViewBag.LeadsConvertidos = leadsConvertidosByConsultorId; ViewBag.LeadsPendentes = leadsPendentesByConsultorId; ViewBag.LeadsProcesso = leadsProcessoByConsultorId; ViewBag.LeadsFinalizados = leadsFinalizadosByConsultorId; //count de Leads if (ViewBag.Leads.Count > 0) { ViewBag.LeadsCount = ViewBag.Leads.Count; } else { ViewBag.LeadsCount = 0; } //count de Leads Convertidos if (ViewBag.LeadsConvertidos.Count > 0) { ViewBag.LeadsConvertidosCount = ViewBag.LeadsConvertidos.Count; } else { ViewBag.LeadsConvertidosCount = 0; } //count de Leads Pendentes if (ViewBag.LeadsPendentes.Count > 0) { ViewBag.LeadsPendentesCount = ViewBag.LeadsPendentes.Count; } else { ViewBag.LeadsPendentesCount = 0; } //count de Leads em Processo if (ViewBag.LeadsProcesso.Count > 0) { ViewBag.LeadsProcessoCount = ViewBag.LeadsProcesso.Count; } else { ViewBag.LeadsProcessoCount = 0; } //count de Leads Finalizados if (ViewBag.LeadsFinalizados.Count > 0) { ViewBag.LeadsFinalizadosCount = ViewBag.LeadsFinalizados.Count; } else { ViewBag.LeadsFinalizadosCount = 0; } ViewBag.Consultores = db.Users.Where(u => u.Vendedor == true).ToList(); ViewBag.DataFinalDefault = dFim; ViewBag.DataInicialDefault = dInicio; ViewBag.DataDiaSemana = DateTime.Today.DayOfWeek; ViewBag.DataInicioSemana = ""; Dictionary<int, int> ParceirosDict = new Dictionary<int, int>(); foreach (var p in ViewBag.Parceiros) { ParceirosDict.Add(p.UserId, p.Leads.Count); } var ParceirosDictSorted = ParceirosDict.OrderByDescending(key => key.Value).ToList(); if (ParceirosDictSorted.Count >= 1) { var ParceiroOuroId = ParceirosDictSorted[0].Key; ViewBag.ParceiroOuroNome = db.Users.Find(ParceiroOuroId).FirstName; ViewBag.ParceiroOuroTotal = ParceirosDictSorted[0].Value; } if (ParceirosDictSorted.Count >= 2) { var ParceiroPrataId = ParceirosDictSorted[1].Key; ViewBag.ParceiroPrataNome = db.Users.Find(ParceiroPrataId).FirstName; ViewBag.ParceiroPrataTotal = ParceirosDictSorted[1].Value; } if (ParceirosDictSorted.Count >= 3) { var ParceiroBronzeId = ParceirosDictSorted[2].Key; ViewBag.ParceiroBronzeNome = db.Users.Find(ParceiroBronzeId).FirstName; ViewBag.ParceiroBronzeTotal = ParceirosDictSorted[2].Value; } return View("Index"); } } }
page modal:
@model macpartner.Models.Dashboard @{ macpartner.Models.MacPartnerContext db = new macpartner.Models.MacPartnerContext(); ViewBag.Title = "Dashboard"; //Definindo data de início da semana if (ViewBag.DataDiaSemana == DayOfWeek.Monday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-1).ToShortDateString(); } else if (ViewBag.DataDiaSemana == DayOfWeek.Tuesday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-2).ToShortDateString(); } else if (ViewBag.DataDiaSemana == DayOfWeek.Wednesday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-3).ToShortDateString(); } else if (ViewBag.DataDiaSemana == DayOfWeek.Thursday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-4).ToShortDateString(); } else if (ViewBag.DataDiaSemana == DayOfWeek.Friday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-5).ToShortDateString(); } else if (ViewBag.DataDiaSemana == DayOfWeek.Saturday) { ViewBag.DataInicioSemana = DateTime.Today.AddDays(-6).ToShortDateString(); } else { ViewBag.DataInicioSemana = ViewBag.DataFinalDefault; } } <head> <meta name="viewport" content="width=device-width" /> <script src="~/Scripts/Chart.bundle.js"></script> <script src="~/Scripts/ut"></script> </head> @section Scripts { <script src="~/Scripts/Chart.bundle.js"></script> <script src="~/Scripts/utils.js"></script> <script type="text/javascript" src="/Scripts/jquery-1.8.3.min.js" charset="utf-8"></script> <script type="text/javascript" src="/Scripts/jquery.maskedinput.js"></script> <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script> <!-- Isolated Version of Bootstrap, not needed if your site already uses Bootstrap --> <link rel="stylesheet" href="https://formden.com/static/cdn/bootstrap-iso.css" /> <!-- Bootstrap Date-Picker Plugin --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css" /> <script> var config1 = { type: 'pie', data: { datasets: [{ data: [ '@ViewBag.LeadsCount', '@ViewBag.LeadsConvertidosCount', ], backgroundColor: [ window.chartColors.red, window.chartColors.green, ], label: 'Leads Cadastratos X Leads Convertidos' }], labels: [ 'Leads Cadastrados', 'Leads Convertidos', ] }, options: { responsive: true, legend: false, } }; var config2 = { type: 'pie', data: { datasets: [{ data: [ '@ViewBag.LeadsPendentesCount', '@ViewBag.LeadsProcessoCount', '@ViewBag.LeadsFinalizadosCount', ], backgroundColor: [ window.chartColors.yellow, window.chartColors.orange, window.chartColors.blue, ], label: 'Situação dos Leads' }], labels: [ 'Leads Pendentes', 'Leads Em Processo', 'Leads Finalizados', ] }, options: { responsive: true, legend: false, } }; var config3 = { type: 'bar', data: { datasets: [{ data: [ '@ViewBag.ParceiroOuroTotal', '@ViewBag.ParceiroPrataTotal', '@ViewBag.ParceiroBronzeTotal', ], backgroundColor: [ window.chartColors.yellow, window.chartColors.silver, window.chartColors.orange, ], label: 'Leads Indicados' }], labels: [ '@ViewBag.ParceiroOuroNome', '@ViewBag.ParceiroPrataNome', '@ViewBag.ParceiroBronzeNome', ] }, options: { responsive: true, legend: false, scales: { yAxes: [{ ticks: { min: 1, display: false, } }] } } }; window.onload = function () { var ctx1 = document.getElementById('chart-area-cadastros-na-plataforma').getContext('2d'); var ctx2 = document.getElementById('chart-area-situacao-dos-leads').getContext('2d'); var ctx3 = document.getElementById('chart-area-podium-parceiros').getContext('2d'); window.myPie = new Chart(ctx1, config1); window.myPie = new Chart(ctx2, config2); window.myPie = new Chart(ctx3, config3); }; </script> <script> $(function () { $('#datepicker').datepicker({ format: 'dd/mm/yyyy', }); $('#datepicker2').datepicker({ format: 'dd/mm/yyyy' }); var ddl = document.getElementById("consultor"); var option = document.createElement("OPTION"); option.value = 0; option.innerText = "Todos"; option.tabIndex = 0; ddl.options.add(option); document.getElementById('consultor').text = "Todos"; $('#consultor').append('<option value="0" selected="Todos">Todos</option>'); $('.count').each(function (index) { $(this).prop('Counter', 0).animate({ Counter: $(this).text() }, { duration: 1000, easing: 'swing', step: function (now) { $(this).text(parseFloat(now).toFixed(0)); } }); }); }); </script> <script> $('#btn-esseMes').click(function () { $('#datepicker').datepicker('setDate', '@ViewBag.DataInicialDefault'); $('#datepicker2').datepicker('setDate', '@ViewBag.DataFinalDefault'); }); $('#btn-essaSemana').click(function () { $('#datepicker').datepicker('setDate', '@ViewBag.DataInicioSemana'); $('#datepicker2').datepicker('setDate', '@ViewBag.DataFinalDefault'); }); </script> <script> $(function () { $("#ParceirosCadastrados").click(function () { var id = $(this).attr("data-id"); $("#parceirosCadastradosModal").load("Details?id=" + id, function () { $("#parceirosCadastradosModal").modal(); }) }); }) $(function () { $("#IndicacoesNaRede").click(function () { var id = $(this).attr("data-id"); $("#IndicacoesNaRedeModal").load("Details?id=" + id, function () { $("#IndicacoesNaRedeModal").modal(); }) }); }) $(function () { $("#LeadsConvertidos").click(function () { var id = $(this).attr("data-id"); $("#LeadsConvertidosModal").load("Details?id=" + id, function () { $("#LeadsConvertidosModal").modal(); }) }); }) $(function () { $("#LeadsPendentes").click(function () { var id = $(this).attr("data-id"); $("#LeadsPendentesModal").load("Details?id=" + id, function () { $("#LeadsPendentesModal").modal(); }) }); }) $(function () { $("#LeadsEmProcesso").click(function () { var id = $(this).attr("data-id"); $("#LeadsEmProcessoModal").load("Details?id=" + id, function () { $("#LeadsEmProcessoModal").modal(); }) }); }) $(function () { $("#LeadsFinalizados").click(function () { var id = $(this).attr("data-id"); $("#LeadsFinalizadosModal").load("Details?id=" + id, function () { $("#LeadsFinalizadosModal").modal(); }) }); }) </script> <script> $('#btn-pesquisar').click(function () { var consultorId = $('#consultor').val(); var dataInicial = $('#datepicker').datepicker({ dateFormat: 'dd,MM,yyyy' }).val(); var dataFinal = $('#datepicker2').datepicker({ dateFormat: 'dd,MM,yyyy' }).val(); window.location.href = '@Url.Action("Filtro", "Dashboards")?consultorId=' + consultorId + '&dInicio=' + dataInicial + '&dFim=' + dataFinal; }); </script> <script> $(".has-load").on('click', function () { $("#load").show(); }); </script> } @if (!User.IsInRole("Admin") && !User.IsInRole("Vendedor") && !User.IsInRole("Analista")) { <div class="jumbotron"> <img class="banner_full" src="https://i.imgur.com/4PJ6DYQ.png" /> <img class="banner_reduzido" src="~/Content/Resources/banner_reduzido.png" /> </div> } @if (User.IsInRole("Admin") || User.IsInRole("Analista") || User.IsInRole("Vendedor")) { <div style="background-color:#e3f0ff "> <div class="jumbotron" style="padding-bottom:0 !important"> <img class="banner_full" src="http://www.kinetek.com/blog/wp-content/uploads/2016/12/dashboard-banner.png" /> @*<img class="banner_reduzido" src="~/Content/Resources/banner_reduzido.png" />*@ </div> <div style="background-color:#d2e7ff; padding-bottom:30px"> <center> <div class="MyNavBar"> <table> <tr> <td> <h5 style="color:white; font-weight: bold">Consultor</h5> </td> <td> <div class="col-md-10"> @{ var consultores = ViewBag.Consultores;} @Html.DropDownListFor(model => consultores, new SelectList( consultores, "UserId", "FirstName", 1), htmlAttributes: new {@id="consultor", @class = "form-control", @style="width:200px;"}) </div> </td> <td> <h5 style="color:white; font-weight: bold">Data Inicial</h5> </td> <td> <input class="form-control" id="datepicker" name="datepicker" value="@ViewBag.DataInicialDefault" type="text" /> </td> <td> <h5 style="color:white; font-weight: bold">Data Final</h5> </td> <td> <input class="form-control" id="datepicker2" name="datepicker2" value="@ViewBag.DataFinalDefault" type="text" /> </td> <td> <input id="btn-esseMes" type="button" class="btn btn-success" value="Este Mês" /> </td> <td> <input id="btn-essaSemana" type="button" class="btn btn-success" value="Esta Semana" /> </td> <td></td> <td> <button id="btn-pesquisar" type="submit" class="has-load btn btn-info"> <span class="glyphicon glyphicon-search"></span> </button> </td> </tr> </table> </div> </center> <center> <div> <h3>Cadastros na Plataforma</h3> <table> <tr> <td width="300px"> <div class="MyDashboardDiv" id="ParceirosCadastrados"> <center> <h4>Parceiros Cadastrados</h4> <h3 class="count">@ViewBag.ParceirosCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="IndicacoesNaRede"> <center> <h4>Indicações na Rede</h4> <h3 class="count">@ViewBag.LeadsCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="LeadsConvertidos"> <center> <h4>Leads Convertidos</h4> <h3 class="count">@ViewBag.LeadsConvertidosCount</h3> </center> </div> </td> </tr> <tr style="background-color:white !important"> <td colspan="3"> <center> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area-cadastros-na-plataforma"></canvas> </div> </center> </td> </tr> </table> </div> <div> <h3>Situação dos Leads</h3> <table> <tr> <td width="300px"> <div class="MyDashboardDiv" id="LeadsPendentes"> <center> <h4>Leads Pendentes</h4> <h3 class="count">@ViewBag.LeadsPendentesCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="LeadsEmProcesso"> <center> <h4>Leads em Processo</h4> <h3 class="count">@ViewBag.LeadsProcessoCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="LeadsFinalizados"> <center> <h4>Leads Finalizados</h4> <h3 class="count">@ViewBag.LeadsFinalizadosCount</h3> </center> </div> </td> </tr> <tr style="background-color:white !important"> <td colspan="3"> <center> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area-situacao-dos-leads"></canvas> </div> </center> </td> </tr> </table> </div> <div> <h3>Pódium de Parceiros</h3> <table> <tr> <td width="300px"> <div class="MyDashboardDiv" id="ParceiroOuro"> <center> <h4>Parceiro Ouro</h4> <h3>@ViewBag.ParceiroOuroNome (@ViewBag.ParceiroOuroTotal Leads)</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="ParceiroPrata"> <center> <h4>Parceiro Prata</h4> <h3>@ViewBag.ParceiroPrataNome (@ViewBag.ParceiroPrataTotal Leads)</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" id="ParceiroBronze"> <center> <h4>Parceiro Bronze</h4> <h3>@ViewBag.ParceiroBronzeNome (@ViewBag.ParceiroBronzeTotal Leads)</h3> </center> </div> </td> </tr> <tr style="background-color:white !important"> <td colspan="3"> <center> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area-podium-parceiros"></canvas> </div> </center> </td> </tr> </table> </div> </center> </div> <br /> </div> } <div class="modal fade" id="parceirosCadastradosModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Parceiros Cadastrados</h4> </div> <div class="modal-body"> <h4>Parceiros Cadastrados no Período</h4> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Nome</h5> </th> <th class="MyTh"> <h5>Sobrenome</h5> </th> <th class="MyTh"> <h5>E-mail</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.Parceiros) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.FirstName</h5> </td> <td class="MyTrTd"> <h5>@item.LastName</h5> </td> <td class="MyTrTd"> <h5>@item.UserName</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="modal fade" id="IndicacoesNaRedeModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Indicações na Rede</h4> </div> <div class="modal-body"> <h4>Indicações Cadastradas na Rede no Período</h4> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Status</h5> </th> <th class="MyTh"> <h5>Nome Fantasia</h5> </th> <th class="MyTh"> <h5>Documento</h5> </th> <th class="MyTh"> <h5>Telefone</h5> </th> <th class="MyTh"> <h5>Contato</h5> </th> <th class="MyTh"> <h5>Seguimento</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.Leads) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.status</h5> </td> <td class="MyTrTd"> <h5>@item.fantasia</h5> </td> <td class="MyTrTd"> <h5>@item.cnpj_cpf</h5> </td> <td class="MyTrTd"> <h5>@item.telefone</h5> </td> <td class="MyTrTd"> <h5>@item.contato</h5> </td> <td class="MyTrTd"> <h5>@item.seguimento</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="modal fade" id="LeadsConvertidosModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Leads Convertidos</h4> </div> <div class="modal-body"> <h4>Leads Convertidos no Período</h4> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Status</h5> </th> <th class="MyTh"> <h5>Nome Fantasia</h5> </th> <th class="MyTh"> <h5>Documento</h5> </th> <th class="MyTh"> <h5>Telefone</h5> </th> <th class="MyTh"> <h5>Contato</h5> </th> <th class="MyTh"> <h5>Seguimento</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.LeadsConvertidos) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.status</h5> </td> <td class="MyTrTd"> <h5>@item.fantasia</h5> </td> <td class="MyTrTd"> <h5>@item.cnpj_cpf</h5> </td> <td class="MyTrTd"> <h5>@item.telefone</h5> </td> <td class="MyTrTd"> <h5>@item.contato</h5> </td> <td class="MyTrTd"> <h5>@item.seguimento</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="modal fade" id="LeadsPendentesModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Leads Pendentes</h4> </div> <div class="modal-body"> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Status</h5> </th> <th class="MyTh"> <h5>Nome Fantasia</h5> </th> <th class="MyTh"> <h5>Documento</h5> </th> <th class="MyTh"> <h5>Telefone</h5> </th> <th class="MyTh"> <h5>Contato</h5> </th> <th class="MyTh"> <h5>Seguimento</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.LeadsPendentes) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.status</h5> </td> <td class="MyTrTd"> <h5>@item.fantasia</h5> </td> <td class="MyTrTd"> <h5>@item.cnpj_cpf</h5> </td> <td class="MyTrTd"> <h5>@item.telefone</h5> </td> <td class="MyTrTd"> <h5>@item.contato</h5> </td> <td class="MyTrTd"> <h5>@item.seguimento</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="modal fade" id="LeadsEmProcessoModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Leads em Processo</h4> </div> <div class="modal-body"> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Status</h5> </th> <th class="MyTh"> <h5>Nome Fantasia</h5> </th> <th class="MyTh"> <h5>Documento</h5> </th> <th class="MyTh"> <h5>Telefone</h5> </th> <th class="MyTh"> <h5>Contato</h5> </th> <th class="MyTh"> <h5>Seguimento</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.LeadsProcesso) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.status</h5> </td> <td class="MyTrTd"> <h5>@item.fantasia</h5> </td> <td class="MyTrTd"> <h5>@item.cnpj_cpf</h5> </td> <td class="MyTrTd"> <h5>@item.telefone</h5> </td> <td class="MyTrTd"> <h5>@item.contato</h5> </td> <td class="MyTrTd"> <h5>@item.seguimento</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="modal fade" id="LeadsFinalizadosModal"> <div class="modal-dialog" style="width:60%"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Fechar</span></button> <h4 class="modal-title">Leads Finalizados</h4> </div> <div class="modal-body"> <div> <table class="table"> <thead> <tr> <th class="MyTh"> <h5>Status</h5> </th> <th class="MyTh"> <h5>Nome Fantasia</h5> </th> <th class="MyTh"> <h5>Documento</h5> </th> <th class="MyTh"> <h5>Telefone</h5> </th> <th class="MyTh"> <h5>Contato</h5> </th> <th class="MyTh"> <h5>Seguimento</h5> </th> </tr> </thead> @foreach (var item in @ViewBag.LeadsFinalizados) { <tbody> <tr> <td class="MyTrTd"> <h5>@item.status</h5> </td> <td class="MyTrTd"> <h5>@item.fantasia</h5> </td> <td class="MyTrTd"> <h5>@item.cnpj_cpf</h5> </td> <td class="MyTrTd"> <h5>@item.telefone</h5> </td> <td class="MyTrTd"> <h5>@item.contato</h5> </td> <td class="MyTrTd"> <h5>@item.seguimento</h5> </td> </tr> </tbody> } </table> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
Monday, February 11, 2019 12:53 PM
Answers
-
User283571144 posted
Hi ecocash,
Hi Brandon, the error occurs in this web page that works with viewbag and modal popup,when I activate the Application_Error, the modal popup gets error page 404
https://drive.google.com/open?id=1OsdVzCJRTirBKuB1gvlEU9D800KC2QgA
https://drive.google.com/open?id=1K9k4rZIr4CEFc6qYYsrvK3_IZA_59Rqe
The reason why you get the 404 error when clicking the model popup is the javascript codes in your view could find the controller view details in your page.
$(function () { $("#LeadsEmProcesso").click(function () { var id = $(this).attr("data-id"); $("#LeadsEmProcessoModal").load("Details?id=" + id, function () { $("#LeadsEmProcessoModal").modal(); }) }); })
I found you firstly load the details view by using load function in your jquery codes.
If the details view couldn't be found it will return 404 error.
If you don't set the Application_Error with redirect, it will not redirect to the error controller. it will just return the 404 error, so you could still see the model popup.
If you set the Application_Error with redirect, it will redirect to the error controller view without showing the model popup.
I suggest you could firstly make sure url "Details?id=...." is right, we could access that page.
Besides,I suggest you could check the codes you have used when click the table. I found you just load the controller's details view instead of show the model popup.
I found you have alread generate the details table in each model popup window. I couldn't understand why you still need load the details view.
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, February 13, 2019 5:29 AM
All replies
-
User283571144 posted
Hi ecocash,
Good Morning, I created some pages of errors and some modal by css, but this one giving error when trying to visualize the modal, instead of loading it the modal it loads a 404 error
Good Morning, I created some pages of errors and some modal by css, but this one giving error when trying to visualize the modal, instead of loading it the modal it loads a 404 error
According to your description, I couldn't understand your issue clearly.
What you mean about loading it the modal it loads a 404 error? Could you please tell me which controller's method(which line) cause this issue?
Since you set the Application_Error, all the exception will go to the Application_Error method.
Best Regards,
Brando
Tuesday, February 12, 2019 7:10 AM -
User-733224187 posted
Hi Brandon, the error occurs in this web page that works with viewbag and modal popup,when I activate the Application_Error, the modal popup gets error page 404
https://drive.google.com/open?id=1OsdVzCJRTirBKuB1gvlEU9D800KC2QgA
https://drive.google.com/open?id=1K9k4rZIr4CEFc6qYYsrvK3_IZA_59Rqe
Tuesday, February 12, 2019 10:31 AM -
User-733224187 posted
Hi Brandon, the error occurs in this web page that works with viewbag and modal popup,when I activate the Application_Error, the modal popup gets error page 404
https://drive.google.com/open?id=1OsdVzCJRTirBKuB1gvlEU9D800KC2QgA
https://drive.google.com/open?id=1K9k4rZIr4CEFc6qYYsrvK3_IZA_59Rqe
Tuesday, February 12, 2019 4:19 PM -
User283571144 posted
Hi ecocash,
Hi Brandon, the error occurs in this web page that works with viewbag and modal popup,when I activate the Application_Error, the modal popup gets error page 404
https://drive.google.com/open?id=1OsdVzCJRTirBKuB1gvlEU9D800KC2QgA
https://drive.google.com/open?id=1K9k4rZIr4CEFc6qYYsrvK3_IZA_59Rqe
The reason why you get the 404 error when clicking the model popup is the javascript codes in your view could find the controller view details in your page.
$(function () { $("#LeadsEmProcesso").click(function () { var id = $(this).attr("data-id"); $("#LeadsEmProcessoModal").load("Details?id=" + id, function () { $("#LeadsEmProcessoModal").modal(); }) }); })
I found you firstly load the details view by using load function in your jquery codes.
If the details view couldn't be found it will return 404 error.
If you don't set the Application_Error with redirect, it will not redirect to the error controller. it will just return the 404 error, so you could still see the model popup.
If you set the Application_Error with redirect, it will redirect to the error controller view without showing the model popup.
I suggest you could firstly make sure url "Details?id=...." is right, we could access that page.
Besides,I suggest you could check the codes you have used when click the table. I found you just load the controller's details view instead of show the model popup.
I found you have alread generate the details table in each model popup window. I couldn't understand why you still need load the details view.
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, February 13, 2019 5:29 AM -
User-733224187 posted
Thank Brando. as it was not me that generated the view I had not noticed that the java loaded a controller.
I fixed it and it's working now
<script> $(function () { $("#ParceirosCadastrados").click(function () { $('#parceirosCadastradosModal').modal('show') }) }) $(function () { $("#IndicacoesNaRede").click(function () { $("#IndicacoesNaRedeModal").modal("show"); }); }) $(function () { $("#LeadsConvertidos").click(function () { $("#LeadsConvertidosModal").modal("show"); }); }) $(function () { $("#LeadsPendentes").click(function () { $("#LeadsPendentesModal").modal("show"); }) $(function () { $("#LeadsEmProcesso").click(function () { $("#LeadsEmProcessoModal").modal("show"); }); }) $(function () { $("#LeadsFinalizados").click(function () { $("#LeadsFinalizadosModal").modal("show"); }); }) </script>
<div> <h3>Cadastros na Plataforma</h3> <table> <tr> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#parceirosCadastradosModal" id="ParceirosCadastrados"> <center> <h4>Parceiros Cadastrados</h4> <h3 class="count">@ViewBag.ParceirosCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#IndicacoesNaRedeModal" id="IndicacoesNaRede"> <center> <h4>Indicações na Rede</h4> <h3 class="count">@ViewBag.LeadsCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#LeadsConvertidosModal" id="LeadsConvertidos"> <center> <h4>Leads Convertidos</h4> <h3 class="count">@ViewBag.LeadsConvertidosCount</h3> </center> </div> </td> </tr> <tr style="background-color:white !important"> <td colspan="3"> <center> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area-cadastros-na-plataforma"></canvas> </div> </center> </td> </tr> </table> </div> <div> <h3>Situação dos Leads</h3> <table> <tr> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#LeadsPendentesModal" id="LeadsPendentes"> <center> <h4>Leads Pendentes</h4> <h3 class="count">@ViewBag.LeadsPendentesCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#LeadsEmProcessoModal" id="LeadsEmProcesso"> <center> <h4>Leads em Processo</h4> <h3 class="count">@ViewBag.LeadsProcessoCount</h3> </center> </div> </td> <td width="300px"> <div class="MyDashboardDiv" data-toggle="modal" data-target="#LeadsFinalizadosModal" id="LeadsFinalizados"> <center> <h4>Leads Finalizados</h4> <h3 class="count">@ViewBag.LeadsFinalizadosCount</h3> </center> </div> </td> </tr> <tr style="background-color:white !important"> <td colspan="3"> <center> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area-situacao-dos-leads"></canvas> </div> </center> </td> </tr> </table> </div> <div>
Wednesday, February 13, 2019 1:19 PM -
User283571144 posted
Hi ecocash,
I'm glad you have solved the issue, if you feel my answer is right, please mark it as answer, it will help other people who faces the same issue to find the answer more easily.
Best Regards,
Brando
Thursday, February 14, 2019 12:14 AM