Prevent postback when minimizing/restoring a radwindow

5 posts, 1 answers
  1. Sam Tran
    Sam Tran avatar
    84 posts
    Member since:
    Nov 2006

    Posted 15 Dec 2011 Link to this post

    Hi,

    I have a RadWindowManager and open up RadWindows client-side through the manager control.
    I'm not sure if I set a property wrong or what, but minimizing/restoring a radwindow causes the page inside the radwindow to postback.
    Maximizing/restoring, moving, resizing the radwindow does not postback.  Only minimize/restore causes a postback.

    The only client event I have on the RadWindowManager is OnClientBeforeClose
    This is the manager:
    <telerik:RadWindowManager ID="RadWindowManagerParent" runat="server" Animation="None" OffsetElementID="wrapper"
        MinimizeZoneID="DivMinimizeZone" RestrictionZoneID="TdContent" EnableTheming="true"
        AnimationDuration="250" DestroyOnClose="true" EnableShadow="true" IconUrl="~/Images/Blue/Window_Icon.png"
        PreserveClientState="true" ShowContentDuringLoad="false" ShowOnTopWhenMaximized="false"
        Width="1000" Height="650" VisibleStatusbar="false" ReloadOnShow="true" KeepInScreenBounds="false"
        Style="z-index: 2501;" Behaviors="Close,Maximize,Minimize,Move,Reload,Resize"
        OnClientBeforeClose="RadWindowManagerParentOnClientBeforeClose">
        <Windows>
        </Windows>
    </telerik:RadWindowManager>

    Any ideas?

    Thanks!!!
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 16 Dec 2011 Link to this post

    Sam:

    Take a look at this forum thread. It should help you here.

    Opening Rad Window Causes Postback

    Cheers.
  3. Sam Tran
    Sam Tran avatar
    84 posts
    Member since:
    Nov 2006

    Posted 13 Jan 2012 Link to this post

    Sorry for the delayed response.  We got a new email server at work and all telerik emails have been going to my junk mail.

    Thanks for the link, but the asker was opening RadWindows from the server-side.

    And Georgi's 2 options were to use a RadAjaxManager or wire up the opening client-side.

    Notice the first sentence of my post:
    "I have a RadWindowManager and open up RadWindows client-side through the manager control."

    So I'm already opening the RadWindows using a client-side javascript function.

    Any other ideas?

    Thanks!!!
  4. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4529 posts

    Posted 17 Jan 2012 Link to this post

    Hello Sam,

    What I can suggest at his point is that you remove the MinimizeZoneID property. Its functionality requires that the RadWindow markup is moved in the DOM which inevitably causes an iframe to reload. You can reproduce this behavior with the following simple code:
    <asp:Button ID="Button1" Text="move first" OnClientClick="moveIframe(); return false;" runat="server" />
    <asp:Button ID="Button2" Text="move second" OnClientClick="moveBackIframe(); return false;" runat="server" />
    <div id="rootDiv" style="width: 500px; height: 500px; border: 1px solid green;"></div>
    <iframe id="myframe" src="content.aspx"></iframe>
    <div id="nextdiv"></div>
     
    <script type="text/javascript">
        function moveIframe()
        {
            var myframe = $get("myframe");
            myframe.parentNode.removeChild(myframe);
            var rootDiv = $get("rootDiv");
            rootDiv.appendChild(myframe);
        }
     
        function moveBackIframe()
        {
            var myframe = $get("myframe");
            myframe.parentNode.removeChild(myframe);
            var nextdiv = $get("nextdiv");
            nextdiv.appendChild(myframe);
        }
    </script>

    Similar behavior can be achieved by combining a RadWindow with RadTabStrip to create a desktop-like environment, you can check out an example in this online demo.

    Kind regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Sam Tran
    Sam Tran avatar
    84 posts
    Member since:
    Nov 2006

    Posted 20 Jan 2012 Link to this post

    Thanks Marin; removing the minimize zone id stopped the postbacks!
Back to Top