SlideShare a Scribd company logo
Dot Net Training
How To Optimize Asp.Net Application ?
Dot Net Training
In this article, we will walk via some performance improvement techniques in ASP.NET
Web Applications.
It’s universal that customer expects the good performance of a web application.
Basically, large-scale Web applications are deployed to load-balancing servers to
share traffic evenly across a number of application servers.
Additional application servers are added without making any further changes to the
application.
The application server might enhance Web application performance; however, there
are ways to improve performance on the developer side as well.
You can follow certain optimization techniques when you code that can reduce a lot of
performance issues. It is essential to know which parts code or code parts can be
optimized, and how you can measure improvements in performance.
Dot Net Training
Here we share a number of optimization techniques that you can use:
Discard objects from the caller method than in the called method.
Use connection pooling such that the connections can be re-used during requirement
of future requests to the database.

Delete white spaces and extra tags to reduce the size of your pages. Make limited
use of graphics and consider using compressed graphics.

Reduce page load times by minimizing the scripts.

Use cascading style sheets to avoid repeated sending of the same formatting
directives to the client.

Use short control names because they generate unique HTMLID names.

Minimize redundant processing by using Page.IsPostBack .

Use for each loop instead of a for loop if possible.

Avoid using ViewState to facilitate faster page loads.
Dot Net Training
Cache the Web pages or a portion if the page is large. Use data caching for improving
the application performance instead of fetching data from a file or database.
Data is stored in the memory of Datasets hence write efficient SQL queries or
procedures that fetch only the required information.
So not use Page.DataBind. Instead, code data bind on specific controls because the
page-level method calls the DataBind method of every control on the page that
supports data binding.
Use minimal, call to DataBinder.Eval because this method uses reflection to access
the arguments that are passed in and to return the results. For example, if a page has
a table of 50 rows and 10 columns, DataBinder.Eval will be named 500 times if you
use DataBinder.Eval on each column. Instead, use clear casting offers better
performance by keeping away the cost of reflection. Cast the Container.DataItem as a
DataRowView, as shown in the following code .
Dot Net Training
<ItemTemplate> <tr> <td><%# ((DataRowView)Container.DataItem) ["First_Name"]
%></td> <td><%# ((DataRowView)Container.DataItem) ["Last_Name"] %></td>
</tr></ItemTemplate>
You can achieve better performance with clear casting if you use a DataReader to
bind your control and use the special methods to retrieve your data. Cast the
Container.DataItem as a DbDataRecord.
<ItemTemplate> <tr> <td><%# ((DbDataRecord)Container.DataItem) .GetString(0)
%></td> <td><%# ((DbDataRecord)Container.DataItem) .GetInt(1) %></td>
</tr></ItemTemplate>
Dot Net Training
Disable useless session states because ASP.NET Manages a session state by default
and lessens the cost in memory when you don’t use it.
For example, if your pages are fixed or when you don’t require to store information
captured in the page.
<@%Page EnableSessionState=”false”%>
make read only session state for retrieving data
<@%Page EnableSessionState =”ReadOnly”%>
Turn off tracing unless needed.
<trace enabled=”false” requestLimit=”8″ pageoutput=”false” traceMode=”SortByTime”
localOnly=”true”>
Use SqlDataReader to visit the read-only data and not DataSet.
You can return multiple result sets by using dynamic SQL, it is preferable to utilize
stored procedures to get multiple result sets
Dot Net Training
Using gzip compression can reduce the number of bytes sent by the server. This helps
faster page loads and also cuts down on bandwidth usage.
If you got a bunch of .NET Web services running in one IIS Application and utilized by
another IIS application, the first call to Web services, in most cases, might be pretty
slow. To speed up the initial call, you can create the XmlSerializers DLL at compile
time.
Hope the above-mentioned points would help you to code at ease.
If you want to learn ASP.Net and perfect yourself in .NET training, then CRB Tech
Solutions would be of great help and support for you. Join us with our updated
program in ASP.Net course.
Stay tuned to CRB Tech reviews for more technical optimization and other resources.
Thank You..!
Dot Net Training
Ad

Recommended

How to optimize asp dot-net application
How to optimize asp dot-net application
sonia merchant
 
How to Boost WordPress Site Speed in 10 Steps
How to Boost WordPress Site Speed in 10 Steps
Lazylord
 
Drupal Caching For Dummies
Drupal Caching For Dummies
Gokul Nk
 
High performance coding practices code project
High performance coding practices code project
Pruthvi B Patil
 
Klmug presentation - Simple Analytics with MongoDB
Klmug presentation - Simple Analytics with MongoDB
Ross Affandy
 
Columnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil Agarwal
Brent Ozar
 
Technology tips to ceo & architect
Technology tips to ceo & architect
Anandkumar R
 
Scaling Web Apps P Falcone
Scaling Web Apps P Falcone
jedt
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
Kevin Griffin
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the Trenches
Habeeb Rushdan
 
Asp.Net Tips
Asp.Net Tips
Susan Begonja
 
Tuga it 2016 improving your application performance
Tuga it 2016 improving your application performance
Nuno Caneco
 
10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites
oazabir
 
IEEE KUET SPAC presentation
IEEE KUET SPAC presentation
ahsanmm
 
Dev411
Dev411
guest2130e
 
Asp.net performance
Asp.net performance
Abhishek Sur
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
Phil Pursglove
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
Phil Pursglove
 
Application Performance Tuning Techniques
Application Performance Tuning Techniques
Ram Nagesh
 
Fullstack LX - Improving your application performance
Fullstack LX - Improving your application performance
Nuno Caneco
 
ASP.NET 4.0 Demo
ASP.NET 4.0 Demo
Abhishek Sur
 
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
DataArt
 
Microsoft asp.net online training
Microsoft asp.net online training
training3
 
Microsoft asp.net online training
Microsoft asp.net online training
training13acutesoft
 
Cache
Cache
ANANDKUMARPATHAK
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
oazabir
 
Asp.net
Asp.net
Yaswanth Babu Gummadivelli
 
What does dot net hold for 2016?
What does dot net hold for 2016?
sonia merchant
 
What does .net hold for 2016?
What does .net hold for 2016?
sonia merchant
 

More Related Content

Similar to How to optimize asp dot net application ? (20)

Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
Kevin Griffin
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the Trenches
Habeeb Rushdan
 
Asp.Net Tips
Asp.Net Tips
Susan Begonja
 
Tuga it 2016 improving your application performance
Tuga it 2016 improving your application performance
Nuno Caneco
 
10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites
oazabir
 
IEEE KUET SPAC presentation
IEEE KUET SPAC presentation
ahsanmm
 
Dev411
Dev411
guest2130e
 
Asp.net performance
Asp.net performance
Abhishek Sur
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
Phil Pursglove
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
Phil Pursglove
 
Application Performance Tuning Techniques
Application Performance Tuning Techniques
Ram Nagesh
 
Fullstack LX - Improving your application performance
Fullstack LX - Improving your application performance
Nuno Caneco
 
ASP.NET 4.0 Demo
ASP.NET 4.0 Demo
Abhishek Sur
 
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
DataArt
 
Microsoft asp.net online training
Microsoft asp.net online training
training3
 
Microsoft asp.net online training
Microsoft asp.net online training
training13acutesoft
 
Cache
Cache
ANANDKUMARPATHAK
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
oazabir
 
Asp.net
Asp.net
Yaswanth Babu Gummadivelli
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
Kevin Griffin
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the Trenches
Habeeb Rushdan
 
Tuga it 2016 improving your application performance
Tuga it 2016 improving your application performance
Nuno Caneco
 
10 performance and scalability secrets of ASP.NET websites
10 performance and scalability secrets of ASP.NET websites
oazabir
 
IEEE KUET SPAC presentation
IEEE KUET SPAC presentation
ahsanmm
 
Asp.net performance
Asp.net performance
Abhishek Sur
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
Phil Pursglove
 
ASP.NET Scalability - NxtGen Oxford
ASP.NET Scalability - NxtGen Oxford
Phil Pursglove
 
Application Performance Tuning Techniques
Application Performance Tuning Techniques
Ram Nagesh
 
Fullstack LX - Improving your application performance
Fullstack LX - Improving your application performance
Nuno Caneco
 
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
Владимир Бронников (Senior .NET Developer, Perfectial) “Performance optimizat...
DataArt
 
Microsoft asp.net online training
Microsoft asp.net online training
training3
 
Microsoft asp.net online training
Microsoft asp.net online training
training13acutesoft
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
oazabir
 

More from sonia merchant (20)

What does dot net hold for 2016?
What does dot net hold for 2016?
sonia merchant
 
What does .net hold for 2016?
What does .net hold for 2016?
sonia merchant
 
Data protection api's in asp dot net
Data protection api's in asp dot net
sonia merchant
 
Authorization p iv
Authorization p iv
sonia merchant
 
Authorization iii
Authorization iii
sonia merchant
 
Authorization in asp dot net part 2
Authorization in asp dot net part 2
sonia merchant
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
sonia merchant
 
Search page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-net
sonia merchant
 
Build a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-net
sonia merchant
 
10 things to remember
10 things to remember
sonia merchant
 
Learn dot net attributes
Learn dot net attributes
sonia merchant
 
Learn about dot net attributes
Learn about dot net attributes
sonia merchant
 
Owin and-katana-overview
Owin and-katana-overview
sonia merchant
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
sonia merchant
 
Next generation asp.net v next
Next generation asp.net v next
sonia merchant
 
Dot net universal apps
Dot net universal apps
sonia merchant
 
Browser frame building with c# and vb dot net
Browser frame building with c# and vb dot net
sonia merchant
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-framework
sonia merchant
 
Silverlight versions-features
Silverlight versions-features
sonia merchant
 
History of silverlight versions and its features
History of silverlight versions and its features
sonia merchant
 
What does dot net hold for 2016?
What does dot net hold for 2016?
sonia merchant
 
What does .net hold for 2016?
What does .net hold for 2016?
sonia merchant
 
Data protection api's in asp dot net
Data protection api's in asp dot net
sonia merchant
 
Authorization in asp dot net part 2
Authorization in asp dot net part 2
sonia merchant
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
sonia merchant
 
Search page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-net
sonia merchant
 
Build a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-net
sonia merchant
 
Learn dot net attributes
Learn dot net attributes
sonia merchant
 
Learn about dot net attributes
Learn about dot net attributes
sonia merchant
 
Owin and-katana-overview
Owin and-katana-overview
sonia merchant
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
sonia merchant
 
Next generation asp.net v next
Next generation asp.net v next
sonia merchant
 
Dot net universal apps
Dot net universal apps
sonia merchant
 
Browser frame building with c# and vb dot net
Browser frame building with c# and vb dot net
sonia merchant
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-framework
sonia merchant
 
Silverlight versions-features
Silverlight versions-features
sonia merchant
 
History of silverlight versions and its features
History of silverlight versions and its features
sonia merchant
 
Ad

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 6-14-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
Wage and Salary Computation.ppt.......,x
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
How to Add New Item in CogMenu in Odoo 18
How to Add New Item in CogMenu in Odoo 18
Celine George
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
2025 Completing the Pre-SET Plan Form.pptx
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
University of Ghana Cracks Down on Misconduct: Over 100 Students Sanctioned
Kweku Zurek
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
SCHIZOPHRENIA OTHER PSYCHOTIC DISORDER LIKE Persistent delusion/Capgras syndr...
parmarjuli1412
 
HistoPathology Ppt. Arshita Gupta for Diploma
HistoPathology Ppt. Arshita Gupta for Diploma
arshitagupta674
 
Wage and Salary Computation.ppt.......,x
Wage and Salary Computation.ppt.......,x
JosalitoPalacio
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
ECONOMICS, DISASTER MANAGEMENT, ROAD SAFETY - STUDY MATERIAL [10TH]
SHERAZ AHMAD LONE
 
How to Add New Item in CogMenu in Odoo 18
How to Add New Item in CogMenu in Odoo 18
Celine George
 
Peer Teaching Observations During School Internship
Peer Teaching Observations During School Internship
AjayaMohanty7
 
This is why students from these 44 institutions have not received National Se...
This is why students from these 44 institutions have not received National Se...
Kweku Zurek
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
2025 Completing the Pre-SET Plan Form.pptx
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
GREAT QUIZ EXCHANGE 2025 - GENERAL QUIZ.pptx
Ronisha Das
 
Ad

How to optimize asp dot net application ?

  • 2. Dot Net Training In this article, we will walk via some performance improvement techniques in ASP.NET Web Applications. It’s universal that customer expects the good performance of a web application. Basically, large-scale Web applications are deployed to load-balancing servers to share traffic evenly across a number of application servers. Additional application servers are added without making any further changes to the application. The application server might enhance Web application performance; however, there are ways to improve performance on the developer side as well. You can follow certain optimization techniques when you code that can reduce a lot of performance issues. It is essential to know which parts code or code parts can be optimized, and how you can measure improvements in performance.
  • 3. Dot Net Training Here we share a number of optimization techniques that you can use: Discard objects from the caller method than in the called method. Use connection pooling such that the connections can be re-used during requirement of future requests to the database.  Delete white spaces and extra tags to reduce the size of your pages. Make limited use of graphics and consider using compressed graphics.  Reduce page load times by minimizing the scripts.  Use cascading style sheets to avoid repeated sending of the same formatting directives to the client.  Use short control names because they generate unique HTMLID names.  Minimize redundant processing by using Page.IsPostBack .  Use for each loop instead of a for loop if possible.  Avoid using ViewState to facilitate faster page loads.
  • 4. Dot Net Training Cache the Web pages or a portion if the page is large. Use data caching for improving the application performance instead of fetching data from a file or database. Data is stored in the memory of Datasets hence write efficient SQL queries or procedures that fetch only the required information. So not use Page.DataBind. Instead, code data bind on specific controls because the page-level method calls the DataBind method of every control on the page that supports data binding. Use minimal, call to DataBinder.Eval because this method uses reflection to access the arguments that are passed in and to return the results. For example, if a page has a table of 50 rows and 10 columns, DataBinder.Eval will be named 500 times if you use DataBinder.Eval on each column. Instead, use clear casting offers better performance by keeping away the cost of reflection. Cast the Container.DataItem as a DataRowView, as shown in the following code .
  • 5. Dot Net Training <ItemTemplate> <tr> <td><%# ((DataRowView)Container.DataItem) ["First_Name"] %></td> <td><%# ((DataRowView)Container.DataItem) ["Last_Name"] %></td> </tr></ItemTemplate> You can achieve better performance with clear casting if you use a DataReader to bind your control and use the special methods to retrieve your data. Cast the Container.DataItem as a DbDataRecord. <ItemTemplate> <tr> <td><%# ((DbDataRecord)Container.DataItem) .GetString(0) %></td> <td><%# ((DbDataRecord)Container.DataItem) .GetInt(1) %></td> </tr></ItemTemplate>
  • 6. Dot Net Training Disable useless session states because ASP.NET Manages a session state by default and lessens the cost in memory when you don’t use it. For example, if your pages are fixed or when you don’t require to store information captured in the page. <@%Page EnableSessionState=”false”%> make read only session state for retrieving data <@%Page EnableSessionState =”ReadOnly”%> Turn off tracing unless needed. <trace enabled=”false” requestLimit=”8″ pageoutput=”false” traceMode=”SortByTime” localOnly=”true”> Use SqlDataReader to visit the read-only data and not DataSet. You can return multiple result sets by using dynamic SQL, it is preferable to utilize stored procedures to get multiple result sets
  • 7. Dot Net Training Using gzip compression can reduce the number of bytes sent by the server. This helps faster page loads and also cuts down on bandwidth usage. If you got a bunch of .NET Web services running in one IIS Application and utilized by another IIS application, the first call to Web services, in most cases, might be pretty slow. To speed up the initial call, you can create the XmlSerializers DLL at compile time. Hope the above-mentioned points would help you to code at ease. If you want to learn ASP.Net and perfect yourself in .NET training, then CRB Tech Solutions would be of great help and support for you. Join us with our updated program in ASP.Net course. Stay tuned to CRB Tech reviews for more technical optimization and other resources.