Reduce HTML file size

C

C Mann

How can I reduce the size of the HTML output produced by Visual Studio 2005
ASP.NET controls.

I have some pages that are 500 - 750kb.

I thought that viewstate would be to blame but the worst of it is code like
this.

<a class="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_0
ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_1"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21">EU</a>

Is there anyway to compress these variable names.

Thanks

C
 
D

darrel

How can I reduce the size of the HTML output produced by Visual Studio
2005 ASP.NET controls.

I have some pages that are 500 - 750kb.

I thought that viewstate would be to blame but the worst of it is code
like this.

Viewstate is often to blame. Definitely turn off viewstate on any of the
controls you don't need it for.

<a class="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_0
ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_1"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21">EU</a>

Is there anyway to compress these variable names.

I don't think so, as that's all being created by the compiler itself.

FYI, if this is a public facing site, note that link buttons aren't terribly
accessible. You might want to forgo the ASP.net menu altogether and go with
a nice HTML + CSS solution.

-Darrel
 
R

Rad [Visual C# MVP]

How can I reduce the size of the HTML output produced by Visual Studio 2005
ASP.NET controls.

I have some pages that are 500 - 750kb.

I thought that viewstate would be to blame but the worst of it is code like
this.

<a class="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_0
ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_1"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvSubjectt21">EU</a>

Is there anyway to compress these variable names.

Thanks

C

You can start by eliminating from your pages any unnecessary text and/or
controls. For instance you don't need an ASP.NET label when plain old text
will do.

Once you have trimmed in this manner then you can look at a number of
options
- IIS compression
- HTTPModule compression
- Tools like http://www.freesoft.fsnet.co.uk/html01.htm

Read these links for more info:

-
http://www.microsoft.com/belux/msdn/nl/community/columns/desmet/compression.mspx
- http://www.codeproject.com/aspnet/HttpCompress.asp
 
C

C Mann

Thanks Darrel.

Back to the old school eh? :)

The link buttons can go, they really don't help.

C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top