Dynamic RadDock Ajax PostBack for DockPositionChanged

2 posts, 1 answers
  1. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 11 Sep 2008 Link to this post

    Using Q2, I am creating Dynamic Docks in the Page_Init event, and for that Dock, I am setting AutoPostBack to true and setting the DockPositionChanged event handler to an appropraite event handler.

    I have no problems with the dock as it moves around as it will postback and call the event, but the problem is the postback is a full page postback and not just the dock. I just want the dock to call the server-side event handler so that I can make the appropraite changes to the layout in the server cache.

    I have tried a couple of things, dynamically adding AjaxSettings for the dock control (this throws all kinds of JavaScript errors), adding the DockZone as a Setting (locks the zone and docks up), and adding the DockLayout as a Setting (works, but causes a lot of flash and loses its client-sized dimensions).

    Please let me know how to make the calls "Ajax" calls as I have searched the forums and looked through the demos and have not found an example that matches what I need to do.

    I have removed any user controls from the dock, so it is an empty dock that causes this problem.

  2. Answer
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 12 Sep 2008 Link to this post

    Ok, I think I solved it. In a hidden div, I added an empty asp:UpdatePanel with Conditional mode. When I create the dynamic docks, I add each dock to the UpdatePanel as a AsyncPostBackTrigger. This performs the postback as expected using Ajax without a full page load.

    I won't be able to update content, but I don't need to update content. I needed to just be able to track the user changes to the docks for later creating.

    AsyncPostBackTrigger widgetTrigger = new AsyncPostBackTrigger ();

    widgetTrigger.ControlID = currentWidget.WidgetId;

    WidgetDockUpdatePanel.Triggers.Add (widgetTrigger);

Back to Top