By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,571 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,571 IT Pros & Developers. It's quick & easy.

Reduce HTML file size

P: n/a

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_tvSubje ct_1"
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHol der1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_t vSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvS ubjectt21">EU</a>

Is there anyway to compress these variable names.

Thanks

C

Mar 20 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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_tvSubje ct_1"
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHol der1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_t vSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvS ubjectt21">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
Mar 20 '07 #2

P: n/a
On Tue, 20 Mar 2007 15:53:58 -0000, C Mann wrote:
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_tvSubje ct_1"
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHol der1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_t vSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvS ubjectt21">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/...mpression.mspx
- http://www.codeproject.com/aspnet/HttpCompress.asp

--
Bits.Bytes
http://bytes.thinkersroom.com
Mar 20 '07 #3

P: n/a

Thanks Darrel.

Back to the old school eh? :)

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

C

"darrel" <no*****@nowhere.comwrote in message
news:uK*************@TK2MSFTNGP05.phx.gbl...
>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_tvSubj ect_1"
href="javascript:__doPostBack('ctl00$ContentPlace Holder1$tabSubject$_ctl0$tvSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHo lder1_tabSubject__ctl0_tvSubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_ tvSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tv Subjectt21">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

Mar 20 '07 #4

P: n/a
On Mar 20, 5:34 pm, "C Mann" <c...@nospam.nospamwrote:
Thanks Darrel.

Back to the old school eh? :)

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

C

"darrel" <notr...@nowhere.comwrote in message

news:uK*************@TK2MSFTNGP05.phx.gbl...
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_tvSubje ct_1"
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tabSubject$_ctl0$t*vSubject','s65\\1')"
onclick="TreeView_SelectNode(ctl00_ContentPlaceHol der1_tabSubject__ctl0_tvS*ubject_Data,
this,'ctl00_ContentPlaceHolder1_tabSubject__ctl0_t vSubjectt21');"
id="ctl00_ContentPlaceHolder1_tabSubject__ctl0_tvS ubjectt21">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- Hide quoted text -

- Show quoted text -
rename controls with shorter name

Mar 20 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.