Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Go Back  Xtreme Visual Basic Talk > > > Reducing Viewstate and Page size on Huge Page!


Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2006, 06:39 PM
kwiksand kwiksand is offline
Newcomer
 
Join Date: Jun 2006
Posts: 11
Default Reducing Viewstate and Page size on Huge Page!


Hi,

I've been building a internal web application for the past few months of which the main input is a 7-page Wizardstep with data filled from all over the place basically.

This is fine in an intranet/LAN sense, but it seems the client now want's this as an external application as well. The problem I have, is the wizard step has grown into a mass behemoth of a page with a 90KB viewstate, totalling about 300KB for the entire page. As you can probably imagine, this is ludicrously large for a web application, when some of the users will be on 256-512KB ADSL connections, and with all the postbacks required it would be basically unusable.

What kind of steps can I be taking to reduce the page size?? The client is very happy with the structure of the wizardstep, and how each field interacts with the other fields and that, so I'd rathe rnot split it up into singular pages, but this may be the only option.

What suggestions (if any) have you got to reduce page size/clutter.

Thanks in advance
Reply With Quote
  #2  
Old 09-14-2006, 07:17 PM
wayneph's Avatar
waynephReducing Viewstate and Page size on Huge Page! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

If you're using .NET 2.0, then you can look into using Atlas and partial Postbacks. That would limit the amount of data sent back and forth.

Otherwise about the only thing I can think of is to split it up into multiple pages. If there are any controls on the page that don't need to have their properties stored in the ViewState, you could also turn off some individual controls.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 09-14-2006, 07:38 PM
kwiksand kwiksand is offline
Newcomer
 
Join Date: Jun 2006
Posts: 11
Default

Quote:
Originally Posted by wayneph
If you're using .NET 2.0, then you can look into using Atlas and partial Postbacks. That would limit the amount of data sent back and forth.

Otherwise about the only thing I can think of is to split it up into multiple pages. If there are any controls on the page that don't need to have their properties stored in the ViewState, you could also turn off some individual controls.
Yeah, its interesting. I'm always conscious of page size in my web apps, but as this was originally internal it wasn't an issue. Interestingly, the master page with images included totals about 10-20KB.

The worst page of the bunch is the 3rd step of this wizard step totalling 354KB. It has 3 Custom Datalists of varying sizes (Vehicle Options & Accessories), 5 Drop Down Lists, one with postback, and 6 Textboxes, all with Data Validators on every control. On one hand, I'd like to reduce the amount of controls/lists, but all information is required for the end product (a Vehicle/Customer Quoting/Leasing/Deployment System).

As such, I can't really see which controls wouldn't require viewstate either. They're all integral to the page, until the next button is clicked, and they're submitted to my object (stored in viewstate).
Reply With Quote
  #4  
Old 09-14-2006, 07:54 PM
wayneph's Avatar
waynephReducing Viewstate and Page size on Huge Page! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

why don't you try storing the object in the session? That way it doesn't get sent back and forth to the browser on every single post back. Only use the ViewState for things that are integral to the page.

As long as you don't have a huge number of users, the server should be able to handle the session variable with out a problem.

Initially I thought you were using a single page for the entire process. If there are more than one, you shouldn't need all of the details on every page.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 09-14-2006, 08:18 PM
kwiksand kwiksand is offline
Newcomer
 
Join Date: Jun 2006
Posts: 11
Default

Quote:
Originally Posted by wayneph
why don't you try storing the object in the session? That way it doesn't get sent back and forth to the browser on every single post back. Only use the ViewState for things that are integral to the page.

As long as you don't have a huge number of users, the server should be able to handle the session variable with out a problem.

Initially I thought you were using a single page for the entire process. If there are more than one, you shouldn't need all of the details on every page.
Thanks for the tips! I'll report back how I go.

Another quick thing. I've just checked the validator scripts rendered to the page for the 350K file, 75K worth! Ridiculous. The bulk of that seems to be taken up by the datalists repeated validators. I imagine the client ID's alone must heavily attribute to page size.

Thanks again!
Reply With Quote
  #6  
Old 09-14-2006, 09:37 PM
wayneph's Avatar
waynephReducing Viewstate and Page size on Huge Page! wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Yeah. If you have a lot of nested controls, the names can get really long really quick. One way around that is to not use descriptive names. (not really a good option.)

Do you have validation scripts repeating? If it's a funciton, it should just need to appear once in the code, and have each Item call a function. That would probably be a little easier on the parser.

To help speed things up, you may also want to look into some Output Caching on controls. If you have things that don't change on every post back have the generated HTML cached so it only has to be sent to the browser. It won't have to be parsed again.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #7  
Old 09-14-2006, 09:46 PM
kwiksand kwiksand is offline
Newcomer
 
Join Date: Jun 2006
Posts: 11
Default

The actual Function isn't repeating, but I have 75KB of:
Code:
var ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2 = document.all ? document.all["ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2"] : document.getElementById("ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2");
ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2.controltovalidate = "ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_txtFOPrice";
ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2.errormessage = "* Price";
ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2.display = "Dynamic";
ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_ContentPlaceHolder1_wzdCreateQuote_dlFactoryOptions_ctl00_FOValidate2.initialvalue = "";
Obviously for each validated control, in each row of the datalist inside the wizard step
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page! Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
 
Reducing Viewstate and Page size on Huge Page!
Reducing Viewstate and Page size on Huge Page!
 
-->