Update Panel + Multiview + Webparts = assertion.

Last post 10-18-2006 6:51 AM by paulecoyote. 1 replies.

Sort Posts:

  • Update Panel + Multiview + Webparts = assertion.

    09-28-2006, 10:38 AM
    • Loading...
    • paulecoyote
    • Joined on 07-31-2006, 6:38 AM
    • Dorset / Hampshire, Uk
    • Posts 10

    Hi there,

      I've been investigating something over the last couple of days and I need some help.

      The multiview works well with an update panel as long as there are not any webparts on it, as soon as webparts are on a hidden view things become impossible.

      WebPartZones have to be registered by the end of the Init phase of a page.  You try and add one after that and the app will throw an application.  At the Init stage though, the MultiView does not know what is going to be shown yet, this happens at the Load stage when ViewState etc is restored.  So the multiview just instatiates the WebPartZone at the Init stage.  This also registers the control with the Atlas ScriptManager.

      By the time the page actually renders though, the view has worked out that it does not need to render the other views.  But the Atlas script manager still has registered all the controls and when it attempts to parse through the script it's made - it asserts because it cannot find the ids of controls that have not been rendered in the hidden views.

      I've tried several ways around this, but it comes back to that any WebPartZone on the page must be Init'ed, and because you cannot unregister a control (or at least flag it to be skipped) from the Script Manager it will always assert if this zone is not present on the page.

       If I could get at the _scriptControls  collection in ScriptManager to remove the web parts from the view that are not being rendered later on in the process - or had a bunch of "UnRegisterControl" type methods in the ScriptManger I could get this working.  

       If anyone has a work around I've not thought of to get around this please let me know.

    Cheers,

    Paul

     

  • Re: Update Panel + Multiview + Webparts = assertion.

    10-18-2006, 6:51 AM
    • Loading...
    • paulecoyote
    • Joined on 07-31-2006, 6:38 AM
    • Dorset / Hampshire, Uk
    • Posts 10

    Microsoft.Web.UI.ScriptManager needs to be changed to fix this problem with controls that must be declared early on in the page cycle but aren't rendered in the end, as the client script asserts because it tries to find things that are not actually there. 

    I cannot effectively extend ScriptManager because:

    • _scriptControls is private, and there are no property accessor or mutators protected or public that I can use to update the collection
    • IScriptControlContainer only has RegisterControl, and no mirror UnregisterControl method - which would seem to be the best place to put UnRegisterControl if it were to be implemented.
    • IScriptManager is an internal interface, so that means I can't inherit that from a seperate assembly

    Is this the right forum to post in to get the attention of Atlas developers?  Is there some other way I should submit this change request? 

    Filed under: , , ,
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter