RadWinow Pops up again unrequested

5 posts, 1 answers
  1. Revital Keren
    Revital Keren avatar
    26 posts
    Member since:
    Jun 2008

    Posted 16 Jun 2009 Link to this post

    Hi,
    I have an aspx with a submit button which open a radWindow on click (server side) using the following lines:

     

    InfoWind.NavigateUrl = "../Meida/InfoContent.aspx + dataObj.ToString();  
    InfoWind.VisibleOnPageLoad = true 


    where InfoWind is the RadWindow.
    In the page that pops up in the window there is a button which closes the window on click calling the following javascript function:

                function WindowClose()  
                {  
                    var oWindow = null;  
                    if (window.radWindow)   
                        oWindow = window.radWindow;  
                    else   
                        if (window.frameElement.radWindow)   
                            oWindow = window.frameElement.radWindow;  
                    oWindow.close();  
                } 

    the code works fine and then the user gets the main window again.
    on that screen there is also a HyperLink control which navigates to a classic asp page which I don't have control over.
    My problem is on this scenario:

    1. the user open the pop up mentioned above by using a submit button
    2. then uses the WindowClose to close the pop up and return to the main window
    3. clicks the HyperLink on the main Window and gets transffered to an asp page.
    4. clicks the browser's Back button to go back to the original main window

     

    in this case the excpected behavior is to get the main window, but what actually happens is that the main window is displayed and right after  that the pop up opens up again...

    Here is the RadWindow and RadWindowManager definitions on the main page:

    <telerik:RadWindowManager  
         EnableEmbeddedSkins="False" KeepInScreenBounds="True" DestroyOnClose="True" 
           Behaviors="Close"  Skin="ReformaSkin"   
            VisibleStatusbar="False"  ID="windowManager"  runat="server" Behavior="Close"   
            InitialBehavior="Maximize"   
            Left="" style="display: none;"  Top="">  
                <windows> 
                    <telerik:RadWindow ID="InfoWind" runat="server" Behaviors="Close, Maximize"   
                        DestroyOnClose="true" EnableEmbeddedSkins="False"   
                        InitialBehavior="Close, Maximize" Left="" NavigateUrl="" Skin="ReformaSkin"   
                        style="display:none;" Modal="false" Top="" RestrictionZoneID="frnHotz"  > 
                    </telerik:RadWindow> 
                </windows> 
        </telerik:RadWindowManager> 


    Please tell me what am I doing wrong?

    Thanx,
    Revital
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 17 Jun 2009 Link to this post

    Hello Revital,

    This behavior is expected and is not related to the RadWindow control, but is a general programming issue. Note that you will face the same task if you are not opening a RadWindow but for example set a text to a Label control.
    My suggestion is to either open the RadWindow on the client or implement a custom logic that will set this property to false when needed.


    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Revital Keren
    Revital Keren avatar
    26 posts
    Member since:
    Jun 2008

    Posted 17 Jun 2009 Link to this post

    The problem is that I have to open the pop up from the server side because I don't have all the information needed (Data wise) on the client side.
    Therefore openning the window from the client side is not an option...

    Changing the VisibleOnPageLoad  property to false sounds like the right solution, only problem is that I never get back again to the server side between closing the child, navigation to a different page or navigation back to the parent window  (as I understand it there is no way for me to do it from the client like in an OnClientClose event or something).

    Do you have any other suggestions for me?
  4. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 18 Jun 2009 Link to this post

    Hi Revital,

    Yes - when you get to the original page by using the Back button, the browser will load a cached version of the page - it does not load it again from the server. As I noted in my previous reply, this issue is not related to a specific RadControl but is a general one.
    The only other suggestion that I can give in your scenario is to use Ajax to open the RadWindow - for example you could wrap the control in an update panel or use RadAjax for that purpose. For convenience I attached a small sample page to this thread that shows what I am talking about.


    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Revital Keren
    Revital Keren avatar
    26 posts
    Member since:
    Jun 2008

    Posted 21 Jun 2009 Link to this post

    Hi Georgi
    Putting the Button inside the UpdatePanel with the RadWindow did the trick!!!

    Thanks a lot,
    Revital



Back to Top