Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5840791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:48:02+00:00 2026-05-22T11:48:02+00:00

I have a html document but it’s size is about 5MB. Here is my

  • 0

I have a html document but it’s size is about 5MB.

Here is my code “../Product/index?page=1” it generates 5MB html :

Plugin url : http://andersonferminiano.com/jqueryscrollpagination/

    <script type="text/javascript">
        $(function () {
            $('#content').scrollPagination({
                'contentPage': '../Product/index?page=1',
                'contentData': {},
                'scrollTarget': $(window),
                'heightOffset': 10,
                'beforeLoad': function () {
                    $('#loading').fadeIn();
                },
                'afterLoad': function (elementsLoaded) {
                    $('#loading').fadeOut();
                    var i = 0;
                    $(elementsLoaded).fadeInWithDelay();
                    if ($('#content').children().size() > 100) {
                        $('#nomoreresults').fadeIn();
                        $('#content').stopScrollPagination();
                    }
                }
            });
            $.fn.fadeInWithDelay = function () {
                var delay = 0;
                return this.each(function () {
                    $(this).delay(delay).animate({ opacity: 1 }, 200);
                    delay += 100;
                });
            };
        });
    </script>
<!--_____________________________________________________________________-->
    @{
    // here is "Product/index" Code
    if (Request.QueryString.HasKeys())
    {
        int iPage = Request.QueryString["page"].AsInt();
        using (var db = new PNUBOOKIR.Models.KowsarSiteEntities())
        {
            var queries = from n in db.vwGood
                          select n;
            long counter = 0;
            for (int i = 1; i <= iPage; i++)
            {
                foreach (var q in queries)
                {
                    counter++;
    <li style="opacity: 0; -moz-opacity: 0; filter: alpha(opacity=0);">
        <p>
            @counter
        </p>
    </li>           
                }
            }
        }
    }
}

I don’t want to load it complete when the scroll goes down it should load 10 other “li” element

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:48:03+00:00Added an answer on May 22, 2026 at 11:48 am

    I do not simulate so heavy page, but I have an other way to load page. Maybe, it can be a reference for you.

    1. Separate each page request at action side, and return for only one page content.
    2. Collect “style” content to css class, to reduce page content.
    3. Improve performance of LINQ with PLINQ.

    I notice the code output every page content.

    var queries = from n in db.vwGood select n;
            long counter = 0;    
    for (int i = 1; i <= iPage; i++)
    {
        foreach (var q in queries)
        {
            counter++;
        }
    }
    

    I suggest you can

    1. modify LINQ with Paging function.
    2. Update LINQ as PLINQ to improve performance. I add AsParallel() after db.vwGood, I am not sure what db.vwGood instance and wish this modify can be good.
    3. Not return HTML content in Razor View, but in Action.

    Pseudo code of Action is as below,

    // iAmount is record amount in each page.
    int iAmount = 50;
    // queries is only the iPage content 
    // but not all of content from page one to page iPage.
    var queries = (from n in db.vwGood.AsParallel() select n)
                  .Skip(iPage - 1).Take(iAmount);
    long counter = 0;
    string strContent = string.Empty;
    foreach (var q in queries)
    {
        counter++;
        // Generate Cotnent here.
        strContent += @"<li class='YourClassName'><p>@counter</p></li>"
    }
    return Content(strContent) 
    

    When ShowMore button is clicked, ShowMore_OnClick() is performanced.

    <input type="button" style="width: 100%" id="BtnShowMore" value="MORE"
        onclick="return ShowMore_OnClick();" />
    

    This is JavaScript for Loading function.
    I notice you do not use button to control content display, but scrollPagination. You can modify the JavaScript to suit with scrollPagination plugin. The thinking of code structure is same.

        var PageNO = 1;
        function ShowMore_OnClick() {
            var BtnShowMore = document.getElementById("BtnShowMore");
            BtnShowMore.value = "Loading...";
            jQuery.post(
                "/Home/GetHomeEventAjax/",
                { "PageNO": PageNO + 1 },
                function (data, states) {
                    if (states == "success") {
                        var EventListArea = document.getElementById("EventListArea");
    
                        var newCommentItem = document.createElement("DIV");
                        newCommentItem.setAttribute("ID", "EventItem");
                        newCommentItem.innerHTML = data;
                        EventListArea.appendChild(newCommentItem);
                        PageNO = PageNO + 1;
                        BtnShowMore.value = "More";
                    }
                }
            );
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have HTML code like so: function toggle_action(type) { var tabs = document.getElementsByName(action_tab) for(var
I have a html document which uses object tag with src attribute. But I
I have an HTML document with an associated appcache manifest. But now I want
I have an HTML document ( here ), which creates an iframe-based media player
I have an HTML document, with the jquery code $(function(){ [...] $(#newNotice).click(function(){ $(#properties).load(testDiagramm.html #NoticeForm);
I have created a simple applet and HTML document, but when I open the
I have a HTML document which llokes like this: <div class=this_can_be_selected>Some text here</div> <div>No
I have an HTML document with the following code <html> <head></head> <body> <div id=wrapper>
I have an HTML document that is using to embed a control. In some
I have an HTML document as a string I want to search for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.