radwindow keeps opening up

6 posts, 1 answers
  1. Mark
    Mark  avatar
    14 posts
    Member since:
    Aug 2007

    Posted 23 Dec 2011 Link to this post

     when I use onclientclose = "Close" that time,
     it closes without postback which what I want, BUT, when page postbacks later if any click event,
     I see that Radwindow back like I never closed it.
    .I have also put .visibleonpageload = false on page load
     on code behind and that seems to be working fine, but not sure if
     this is a proper way to
     handle this or not since I was actually had that on the client side too..
    . What I need to do? any idea?
     

    <
    telerik:RadWindowManager Behaviors="Close, Move, Resize,Maximize" ID="RadWindowManager"
            DestroyOnClose="true" runat="server" IconUrl="http://www.telerik.com/favicon.ico"
            Modal="true">
            <Windows>
     <telerik:RadWindow ID="winConfirmDelete" VisibleOnPageLoad="false" runat="server"
                    Title="Confirm Delete" VisibleStatusbar="false" CssClass="radWindow" Width="300"
                    Height="175" Skin="Windows7" onclientclose="Close">
                    <ContentTemplate>
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td colspan="2">
                                    <br />
                                    <p style="text-align: center">
                                        <asp:Label ID="lblConfirmResult" runat="server" CssClass="validationWarning" Text="Are you sure you want to delete this?" /></p>
                                    <p style="text-align: center">
                                        <telerik:RadButton ID="btnConfirmDelete" runat="server" Text="Delete" OnClick="btnConfirmDelete_Click" />
                                        <telerik:RadButton ID="btnConfirmCancel" runat="server" Text="Cancel" OnClick="btnConfirmCancel_Click" />
                                    </p>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </telerik:RadWindow>
      </Windows>
        </telerik:RadWindowManager>
     
    // have these inside the javascript stuff..
     

       //close without postback.         
       function Close(sender, eventArgs) {
     
                    sender.close();
            }
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Dec 2011 Link to this post

    Hello,

    Try setting EnableViewState property of RadWindowManager as false.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 27 Dec 2011 Link to this post

    Hi Mark,

    What Princy advises will fix the problem in case you set VisibleOnPageLoad="true" for the RadWindowManager at some time in your server code. However, I cannot see this is in the code fragment you have provided. 

    In case you set the VisibleOnPageLoad to true to a RadWindow itself, not to the manager, the correct way to resolve the problem is the one you have used, to reset the property to false in code-behind.

    Please, determine which of those scenarios you are using (whether you set the property to the manager or the separate window itself) and use the corresponding solution. In case you need further assistance, please share a sample page with your scenario isolated along with detailed reproduction steps and explanations and we will modify it in order to meet your needs.

    Greetings,
    Svetlina Anati
    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. Steve
    Steve avatar
    84 posts
    Member since:
    Aug 2013

    Posted 21 Nov 2013 Link to this post

    No matter what I try, the popup window keeps appearing when I do a postback. I've tried setting the VisibleOnPageLoad =False, both as an attribute of the RadWindow, and I've tried setting it in the code-behind. I tried setting the EnableViewState=False in the attributes of the RadWindowManager, and I've tried setting it in the code-behind. No matter what I try, the darn pop-up keeps coming back! I just can't get it to stay closed.

    This is the code I call to open the window from the code-behind

    Private Sub ShowSticky()
         Dim url As String = "../Clients/Sticky.aspx?S=" + storeid + "&C=" + scustomerid
         RadSticky.NavigateUrl = url
         RadSticky.Width = 500
         RadSticky.Height = 500
         RadSticky.VisibleOnPageLoad = False
         RadWindowManager1.EnableViewState = False
     
         Dim script As String = "function f(){$find(""" + RadSticky.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
         RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)
     
     End Sub

    This is the WindowManager:

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" EnableViewState="false">
        <Windows>
            <telerik:RadWindow ID="RadMemo" runat="server" ShowContentDuringLoad="false" Width="750px"
                        Height="600px" Title="medSpa POS Memo" Behaviors="Default" VisibleStatusbar="false">
            </telerik:RadWindow>
            <telerik:RadWindow ID="RadSticky" runat="server" ShowContentDuringLoad="false" Width="500px" AutoSize="false"
                        Height="500px" Title="medSpa POS Sticky" Behaviors="None" VisibleStatusbar="false" Animation="None" MaxHeight="500" MaxWidth="500" >
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    Am I missing something or not doing something correctly? This is driving me nuts!

  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 22 Nov 2013 Link to this post

    Hello Steve,

    I have just replied to your support ticket on the matter and I suggest we keep looking for the resolution there. You could post it here as well once we reach a conclusion.
    In the meantime I am pasting my reply here in case it helps someone else:



    There is no reason for this behavior in the snippets below. I created a small sample with them and things work as expected for me. You can find it attached together with a short video from my experiment. The only reason I can see for such a problem is that some custom logic calls the ShowSticky sub when it should not. Can you confirm if this is the case (e.g., by adding a breakpoint there to see when it is executed and what the stack trace is)?

    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  7. Steve
    Steve avatar
    84 posts
    Member since:
    Aug 2013

    Posted 22 Nov 2013 Link to this post

    I verified and you are correct. The leg of code to open it is being executed each time. I didn't realize it was going through that logic...Thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017