Designing for Performance

Neal

Forum Admin
Staff member
Joined
Jun 2, 2004
Messages
123
Location
VA
Programming Experience
10+
I am building a small asp.net application that started out as a small project and is now growing into quite an involved application. I put everything on one page (Default.aspx) and was just using the asp panel control to show/hide areas. Well, the viewstate grew quite large (datagrids in use as well) and now I want to "break it up" to see if I can make it perform better.

I was thinking of two options, again, keep viewstate in mind as that's the biggy here, the text/source sent to the client. I took each panel with contents and placed them in their own user control now (.ascx). So the Default.aspx page can load the user controls for use. Which if the two options will keep the viewstate under control (yes, viewstate is required), or do these both end up in the same end result:

  1. Drag and drop each of the five usercontrols onto the main page, then just set visibility toggles to only show one depending on the navigation area. Only 1 is shown at any one time, out of 5 areas.
  2. Use a asp placeholder control and do a Loadcontrol when the control is called
So, do they both end up the same, or is #2 better as only one control is actually loaded? I guess my question is, with #1, dragging and dropping user controls, are they loaded all the time, or only when set to visible? (viewstate). I think since it's server side, and not visible, it isn't sent to the client.

Come to think of it, if you put a gazillion controls on a web form but all but one are visible, would that affect performance (client side)? I am now thinking that breaking this into components is going to make no difference!

Any suggestions?
 
Top Bottom