How to Speed up a ASP.NET web application?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NitinSawant
    Contributor
    • Oct 2007
    • 271

    How to Speed up a ASP.NET web application?

    Dear sir,

    I am writing an 3-tier enterprise asp.net web application which needs to be very lightweigt to lower the bandwidth usage.

    I want to speed up ASP.NET web page loading, I have minified all js and css, used AJAX, used less images in page, used paging for grids but still the overall response page size goes to nearly 1Mb because of viewstate hidden fields.

    May I request you to tell how to overcome this issue?

    Cheers,
    Nitinjs
  • aspdotnetuser
    New Member
    • Nov 2010
    • 22

    #2
    Hi,

    whats the density of records your application grid has?
    if the count is more, use custom pagination by limiting records to say 10/25/50/100 to any suitable number.
    Because, though you apply pagination asp.net request all of the records from server before paginating...

    Comment

    • NitinSawant
      Contributor
      • Oct 2007
      • 271

      #3
      Thanks for your reply,
      I've used custom pagination which gets only specific records according to pageindex

      Regards,
      Nitin

      Comment

      • aspdotnetuser
        New Member
        • Nov 2010
        • 22

        #4
        If you are in Asp .Net 4.0 it offers a feature like switching OFF the page level viewstate and switching ON the control level viewstate..so that all unnecessary controls viewstate are not maintained.Chec k that might help a bit, not a big leap

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          I had a client who came to me with this issue last year. The only solution was not to use asp.net. The viewstate size issue is the biggest thorn with this thing and one of the many reasons I'd never use it.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            ViewState can grow quite big.
            There are solutions (like strangeloop) that use hardware to strip out ViewState before the HTML is sent to the browser...it then recreates ViewState when the page posts back to the server. Your page won't notice the difference but the HTML will be much cleaner.

            Comment

            • NitinSawant
              Contributor
              • Oct 2007
              • 271

              #7
              What about using ASP.NET MVC?

              Comment

              • zahrobsk
                New Member
                • Aug 2013
                • 1

                #8
                Reducing ViewState overhead in GridView controls

                Sometimes roll-your-own solutions are the best... EnableViewState ="false" is only part of the answer. You can get around the GridView overly-huge ViewState issue nicely using the following steps:
                1. Make sure your loading happens in the Page_Init stage so that UserControls render before the parent Page_Load
                2. Use a single WebControls.Lit eral for each Template column which should eventually contain controls
                3. Render the web controls you need dynamically into the Literal, either on RowDataBound or when Dynamically creating TemplateField(s ) in your GridView. (You can also use HTML strings here and reuse the same control IDs for each row.)
                4. Use JavaScript to update "__EVENTTAR GET" and "__EVENTARGUMEN T" before post back. Usually the control name and unique row ID are enough.
                5. Conditionally read and process all of the Request keys in Page_Load since the dynamic controls will not be mapped to specific methods in the code behind.
                6. Rebind your grid with updated values in your data source instead of trying to alter the GridViewRows which are no longer fully-persisted.

                This gets rid of all of the useless ViewState data for buttons. It can also put the control values for each row in a comma-delimited list under one control id, so empty inputs take up only one byte for the extra comma. Using this strategy, I was able to completely eliminate paging from my grids and support overflow scrolling inside a div instead.

                Comment

                Working...