How do I make my page do not delay in loading since I have many records inserted?

0

As I do so that the website where I have many records does not take so long to load, currently its average reload is 30 seconds, that's a long time, the problem is not found in the server since that query when the debugging takes 2 to 3 seconds of time. However, where I see that it takes longer is when loading the .NET aspx (web forms) because even the JS loads very fast and almost does not take, but at the time of designing the website takes 30 seconds and I do not know if it is due to the amount and information, but it is still a long time for an amount close to 1000 records.

MasterPage code:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="WebSite.master.cs" Inherits="WebSite" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Content/boostrap.css" rel="stylesheet" />
    <link href="Content/datatables.css" rel="stylesheet" />
    <link href="Content/fontawesome.min.css" rel="stylesheet" />
    <link href="Content/AppView.css" rel="stylesheet" />
    <link href="Plugins/JBox4.9/Source/jBox.css" rel="stylesheet" />
    <link href="Plugins/animate.min.css" rel="stylesheet" />
    <link rel="shortcut icon" type="image/x-icon" href="Multimedia/img/isban_cube.ico" />
    <script src="Js/jquery.js"></script>
    <script src="Plugins/bootstrap.min.js"></script>
    <script src="Js/datatablesjs.js"></script>
    <script src="Plugins/jquery.autosize.min.js"></script>
    <script src="Plugins/bootstrap-confirm.min.js"></script>
    <script src="Js/AppView.js"></script>
    <script src="Js/spin.js"></script>
    <script src="Plugins/JBox4.9/Source/jBox.min.js"></script>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
<asp:ContentPlaceHolder id="body" runat="server">
</asp:ContentPlaceHolder>
</body>
</html>

Back end code: (Here it almost takes nothing)

public  void SendTable(int id)
    {

        try {

            string path = "";
            string[] pathId = new string[5];
            if (id == 0)
            {

                HttpCookie myCookieRead = Request.Cookies["Login"];
                if (myCookieRead == null)
                {
                    Response.Redirect("Login.aspx");
                }
                string Logueo = myCookieRead.Value;
                pathId = Logueo.Split('?');
            }
            else
            {
                path = HttpContext.Current.Request.Url.AbsoluteUri;
                pathId = path.Split('%');
            }



            string htmlstr = "";
            int countRecord = 1;
            if (pathId[0].Equals("0"))
            {
                List<UploadExcel> tbUpload = new List<UploadExcel>();

                tbUpload = LoadTable(0, "", "tb_uploadexcel","Nothing",2);
                foreach (UploadExcel elemento in tbUpload)
                {
                    htmlstr += "<tr><td>" + countRecord++ + "</td><td>" + elemento.StrUser + "</td><td>" + elemento.StrApplicativeUploadExcel + "</td><td>" + elemento.StrServeUploadExcel + "</td><td> " + elemento.StrGroupUploadExcel + " </ td ><td> " + elemento.StrPlataformUploadExcel + "  </td><td> " + elemento.StrDescribeUseUploadExcel + " </ td >" +
                               "<td> <div class='col-lg-12 text-center'><i class='fa fa-check icons' title='Aqui usted podra iniciar una certificacion sobre algun usaurio.' onclick='saveCerti(" + elemento.IdUploadExcel + ");' aria-hidden='true'></i></div>" +
                               "" +
                               "</td></tr>";
                }
                ModalPDF.Visible = false;
                ModalPDFCertificated.Visible = false;
                ModalFinish.Visible = true;
            }
            else
            {
                List<UploadExcel> tbUpload = new List<UploadExcel>();

                tbUpload = LoadTable(0, "", "tb_uploadexcel", "Nothing",2);
                foreach (UploadExcel elemento in tbUpload)
                {
                    htmlstr += "<tr id='" + elemento.IdUploadExcel + "'><td >" + countRecord++ + "</td><td>" + elemento.StrUser + "</td><td>" + elemento.StrApplicativeUploadExcel + "</td><td>" + elemento.StrServeUploadExcel + "</td><td> " + elemento.StrGroupUploadExcel + " </ td ><td> " + elemento.StrPlataformUploadExcel + "  </td><td> " + elemento.StrDescribeUseUploadExcel + " </ td >" +
                               "<td> <div class='col-lg-4 text-center'><i class='fa fa-check icons' title='Aqui usted podra iniciar una certificacion sobre algun usaurio.' onclick='saveCerti(" + elemento.IdUploadExcel + ");' aria-hidden='true'></i></div>" +
                               "<div class='col-lg-4 text-center'><i class='fa fa-pencil icons' title='Aqui usted puede editar el registro subido por excel-' onclick='GetInfo(" + elemento.IdUploadExcel + ");' aria-hidden='true'></i></div>" +
                               "<div class='col-lg-4 text-center'><i class='fa fa-eraser icons' title='Aqui usted podra borrar el registro que desee.' aria-hidden='true' onclick='AlertDelete(" + elemento.IdUploadExcel + ");'></i></div></td></tr>";
                }
                ModalPDF.Visible = true;
                ModalPDFCertificated.Visible = true;
                ModalFinish.Visible = false;
            }
            string Name = "";
            if (id == 0)
            {
                NameUser.InnerText = pathId[1];
            }
            else
            {
                Name = pathId[1].Replace("+", "  ");
                string subName = Name.Replace("3f", " ");
                NameUser.InnerText = subName;
            }

            BodyInformation.InnerHtml = htmlstr;

        } catch (Exception exc) {

            Page.ClientScript.RegisterStartupScript(GetType(), "hwa", "alertsShowError('Error','" + exc.Message + "','danger');", true);

        }




    }
    
asked by David 17.11.2018 в 00:28
source

0 answers