473,394 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to Speed up a ASP.NET web application?

270 100+
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
Dec 4 '10 #1
7 3358
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...
Dec 5 '10 #2
NitinSawant
270 100+
Thanks for your reply,
I've used custom pagination which gets only specific records according to pageindex

Regards,
Nitin
Dec 5 '10 #3
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.Check that might help a bit, not a big leap
Dec 5 '10 #4
drhowarddrfine
7,435 Expert 4TB
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.
Dec 5 '10 #5
Frinavale
9,735 Expert Mod 8TB
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.
Dec 6 '10 #6
NitinSawant
270 100+
What about using ASP.NET MVC?
Dec 19 '10 #7
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.Literal 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 "__EVENTTARGET" and "__EVENTARGUMENT" 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.
Aug 28 '13 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Stijn Oude Brunink | last post by:
Hello, I have the following trade off to make: A base class with 2 virtual functions would be realy helpfull for the problem I'm working on. Still though the functions that my program will use...
18
by: Jeff Boes | last post by:
I'm sure this is a concept that's been explored here. I have a table (fairly simple, just two columns, one of which is a 32-digit checksum) with several million rows (currently, about 7 million)....
60
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I...
2
by: Abubakar | last post by:
Hi, I have a small sockets application and I'm adding a feature in it to transfer files. Since I also want to give it a transfer resume feature so this means I'll be transfering in specific bytes...
6
by: Ham | last post by:
Yeah, Gotto work with my VB.Net graphic application for days, do any possible type of code optimization, check for unhandled errors and finally come up with sth that can't process 2D graphics and...
12
by: Marty | last post by:
Hi, I am building an application that need high speed of execution. There is a lot of string parsing that I do in VB.NET. Do I gain in speed if all that string parsing is made in a dll coded...
5
by: Cylix | last post by:
I have created an VB.Net application, but I found the startup speed is really slow. Once I start the application and I close it and re-open, The speed is much faster, I know that this is common on...
2
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split...
1
by: =?Utf-8?B?TWFyayBT?= | last post by:
I have an application that consists of a managed C++ wrapper around an unmanaged C++ "engine" that performs a very processor intensive task. In the application I create two instances of the...
4
by: Peted | last post by:
hi, im wondering if there is a definitve answer to this. If you build a winforms/wpf application in vs2008, when you have compiled and run the app, does it run as fast (in general) as if you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.