Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I minimize the weight of my ASP.NET pages?

I rely heavily on nested Master Pages in my web portal, this causes ASP.NET to generate huge ID tags for controls it creates, for example: "ctl00_ctl00_MainBody_ctl00_lblDescription"

for a lblDescription Label i've created.

Is there any way to reduce this clutter?

Any other techniques(sorry for being general) to reduce page weight other than removing the viewstate?

like image 258
Eytan Levit Avatar asked Jan 28 '09 20:01

Eytan Levit


2 Answers

  • Look at Yslow and do what it tells you (I would start here)
  • Turn off viewstate
  • Use jsmin to reduce the size of your JavaScript files
  • Reduce the size of your CSS (dead link)
  • Compress your response with standard gzip/deflate compression
  • Using ASP.NET MVC will give you smaller IDs
like image 170
Seibar Avatar answered Oct 04 '22 20:10

Seibar


Whenever possible use HTML Controls. HTML Controls. They are lighter since don't have server-side objects unless you specify the runat="server" attribute.

like image 22
Igor Zelaya Avatar answered Oct 04 '22 22:10

Igor Zelaya