Beginner ASP.NET help

C

Chris

Hi all,

I've built a site using ASP.NET (my first) and currently it has no content.
The layout and design is done (only 4kb of images used). Testing it out on
my webserver I notice a large load time for each page. On investigating,
each page seems to download 2 "WebResource.axd" files, one being 32.41 kB
and the other 20.52 kB.
I use the menu control (static with 1 level) and navigation control. Are
these the cause of the two above files?
My site has literally 5 pages and a near 60kb download per page view seems
slightly excessive? Is there anything I do to stop or reduce this?

Chris
 
J

Juan T. Llibre

re:
I use the menu control (static with 1 level) and navigation control. Are these the cause of the
two above files?

Yes.

In order for the DHMTL functionality/navigation/validation features in controls to be handled,
the necessary js scripts/embedded images/etc. need to be returned to the client.

See :

http://wintellect.com/WEBLOGS/wintellect/archive/2005/09/12/2260.aspx

http://www.nikhilk.net/WebResourceAttribute.aspx

http://msdn.microsoft.com/msdnmag/issues/04/12/CuttingEdge/

Victor Garcia Aprea has a very good explanation at :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/webresource.asp

Basically, webresource.axd is new client-facing handler introduced with ASP.NET 2.0
that delivers dynamically generated JScript to minimize postbacks, etc.

If you didn't use webresource.axd, you'd have to write your own javascript
routines to handle validation, navigation and other functionality you need.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
M

^MisterJingo^

Juan said:
re:

Yes.

In order for the DHMTL functionality/navigation/validation features in controls to be handled,
the necessary js scripts/embedded images/etc. need to be returned to the client.

See :

http://wintellect.com/WEBLOGS/wintellect/archive/2005/09/12/2260.aspx

http://www.nikhilk.net/WebResourceAttribute.aspx

http://msdn.microsoft.com/msdnmag/issues/04/12/CuttingEdge/

Victor Garcia Aprea has a very good explanation at :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/webresource.asp

Basically, webresource.axd is new client-facing handler introduced with ASP.NET 2.0
that delivers dynamically generated JScript to minimize postbacks, etc.

If you didn't use webresource.axd, you'd have to write your own javascript
routines to handle validation, navigation and other functionality you need.

Thanks for the explaination and links. I'm still slightly concerned
about the 60kb download for a page weighing in at 6kb. Is it normal for
a nav with 2 elements (root - 1 level down) max to have a webresource
file size of 20.52 kB, and a menu with 6 links, no levels and static, a
filesize of 32.41 kB both full of JS? I could write simple hyperlinks
to do the job I need doing and that would take a few kb at best. Should
I just use manually written navigation and menu for such a small site?
I tried using the menu and nav with a sitemap to save time writing
them, but if it slows up my page by 6-8 secs on a dial up I'd rather
not use them for my current site.
I guess i'm asking, are these file sizes for such simple tasks normal?
And if not, what am I doing wrong?

Chris
 
J

Juan T. Llibre

re:
Should I just use manually written navigation and menu for such a small site?

For a small site it's often easier to stick with the basics, instead of using built-in objects
which have a pre-specified load factor which must serve many purposes, and not
only the small subset you might actually need for a small site.

re:
are these file sizes for such simple tasks normal?

No, if you only intend to have the limited features a small site demands.
For larger, more complex, sites, yes, it's quite normal.

re:
And if not, what am I doing wrong?

Nothing at all.

If the navigation resources which you need for that site are simple, roll your own.
You'll wind up with a much lighter page load factor.

btw, here's an additional tip which might reduce page load size :

Set <pages enableViewState"false"> in web.config, if you never use ViewState

or...
set <pages enableViewState"true"> in web.config
and turn it *off* in individual pages in which you don't use ViewState :

<%@ Page EnableViewState="false" %>

That should clip off some more page load size.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 

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

Top