Page view counter

Are closed WebParts on personalized pages loaded on page request?

Last post 12-18-2003 8:57 AM by NikhilKo. 4 replies.

Sort Posts:

  • Are closed WebParts on personalized pages loaded on page request?

    11-21-2003, 5:58 PM
    • Loading...
    • guam-aspdev
    • Joined on 08-08-2002, 2:14 AM
    • Guam
    • Posts 111
    • Points 525
    Hi everyone,

    I’ve got a comment/question about the loading of WebParts in situations where personalization settings are persisted over time in order to display a custom site for each user, according to their preferences.

    Suppose I offer a fairly large homepage, consisting of (1) several hard-anchored areas that can’t be moved and (2) several sections in WebPartZones that can be moved, minimized or closed. Assume now that a user opts to personalize a page, then chooses to “close” one of more WebParts, then saving this state as her personal profile. She’ll inevitably leave my page, close her browser, etc.

    Logically, the next time she requests my page, the WebPartZones should display content and in the states as dictated by her personalized profile. Does this mean that the one or more WebParts she turned off will still be load, even though they won’t be displayed? I would hope not, to save on total page processing time.

    I’m not sure of the behavior at this point, but I’m going to test this in awhile by turning several off and doing simple tracing to see what controls get loaded, but I didn’t know if anyone had proven it already. If anyone has any comments/feedback, that would be great.

    Thanks!
    Jas
  • Re: Are closed WebParts on personalized pages loaded on page request?

    11-21-2003, 9:58 PM
    • Loading...
    • mharder
    • Joined on 11-22-2002, 12:03 PM
    • Redmond, WA
    • Posts 917
    • Points 4,537
    • Moderator
    If a web part was added by an individual user, then the web part is completely deleted when the user closes it.

    If a web part is defined statically in the .aspx file, or was added dynamically to the page in AllUser mode, then the web part cannot be deleted, but is instead marked internally as "closed". A "closed" web part isn't really gone, since it appears in the page catalog, and can be added back to the page by the user at any time.

    In the PDC build, a "closed" web part is instantiated and parented to the WebPartManager like all other web parts. A "closed" web part will be executed through all the phases of its lifecycle, except that its Render() method will not be called.

    Performance was not one of our goals for the PDC release, but it is definitely a goal for future releases. We will consider this scenario when working on WebParts performance. Thanks for the suggestion.
    http://blogs.msdn.com/mharder

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Are closed WebParts on personalized pages loaded on page request?

    11-21-2003, 11:33 PM
    • Loading...
    • guam-aspdev
    • Joined on 08-08-2002, 2:14 AM
    • Guam
    • Posts 111
    • Points 525
    Thanks! That's a great answer...exactly what I was looking for!
  • Re: Are closed WebParts on personalized pages loaded on page request?

    11-22-2003, 8:06 AM
    • Loading...
    • guam-aspdev
    • Joined on 08-08-2002, 2:14 AM
    • Guam
    • Posts 111
    • Points 525
    Another comment on this topic:

    Since a closed WebPart gors through the enture lifecycle, would it be a best practice for top performance to put the non-intensive code for WebParts in Init or Load, and not the Render() method? Sounds logical...this would save on the total processing time for a control, and not sacrifice downloading for something that the client turned off.

    Then, this would really achieve the desired result of having closed WebParts make the page load faster!
  • Re: Are closed WebParts on personalized pages loaded on page request?

    12-18-2003, 8:57 AM
    • Loading...
    • NikhilKo
    • Joined on 06-10-2002, 5:32 PM
    • Redmond, WA
    • Posts 92
    • Points 2,352
    • AspNetTeam
    Typically most processing in server controls should be done in OnPreRender and Render. A closed web part should not go through either pre-render or render. So yes, closed web parts shouldn't consume a whole lot of processing time.
    Nikhil Kothari

    Weblog: http://www.nikhilk.net
Page 1 of 1 (5 items)