No Windows opens in UpdatePanel

4 posts, 0 answers
  1. anonym
    anonym avatar
    26 posts
    Member since:
    Apr 2009

    Posted 10 Jul 2009 Link to this post

    Hello, i have a problem with this code, no Window will show when i click my button:


     
    <asp:UpdatePanel ID="upnl" runat="server"
    <ContentTemplate> 
     
     
    <script type="text/javascript"
     
            function OnClientClose(oWnd, args) { 
                var arg = args.get_argument(); 
                window.location.href = 'default.aspx'
                window.location="http://www.yourdomain.com/"
                             
                if (arg=="1") { 
                    window.location.href = 'default.aspx'
                } 
                else { 
                window.location.href = 'default.aspx'
                    return false; 
                } 
                 
                function OpenWindow() 
                    { 
                        var wnd = window.radopen(null, "RadWindow2");          
                        wnd.setSize(400,400); 
                        return false; 
                    }            
        </script> 
         
    <telerik:RadWindowManager VisibleOnPageLoad="true" ID="RadWindowManager1"  runat="server" OnClientClose="OnClientClose"
    <Windows> 
          
        <telerik:RadWindow ID="RadWindow2" runat="server" Title="Edit" Modal="True" VisibleOnPageLoad="true" 
    Skin="Web20" 
            VisibleTitlebar="False" VisibleStatusbar="False" InitialBehavior="None" Height="260" Width="380" /> 
              
          </Windows> 
        </telerik:RadWindowManager> 
     
    ... 
     



    Has someone a solution??
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jul 2009 Link to this post

    Hello,

    I am not sure about how are you calling the OpenWindow function. If you are calling using OnClientClick of ASP.NET button, then you need to cancel the postback in order to show the window as shown below.

    ASPX:
     
    <asp:Button ID="Button2" runat="server" Text="Button" OnClientClick="OpenWindow(); return false;" /> 

    Another option is setting the OpenerElementID property to ButtonID for opening the window on clicking the button.

    Thanks,
    Princy.
  3. anonym
    anonym avatar
    26 posts
    Member since:
    Apr 2009

    Posted 10 Jul 2009 Link to this post

     Here i call a function:

       <asp:ImageButton ID="ibBuy" OnClick="ibBuy_Click" runat="server" /> 


    which set an url and then set it to the window:

    protected void ibBuy_Click(object sender, ImageClickEventArgs e) 
        {       
            string url = "myurl.aspx?returnurl=dialog_buyitnow.aspx?ProductID=23423"
     
            //RadWindowManager1.OnClientPageLoad = "OpenWindow()"; 
            RadWindow2.VisibleOnPageLoad = true
            RadWindow2.NavigateUrl = "~/" + url; 
        } 
     


    How to set the window visible?
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 15 Jul 2009 Link to this post

    Hello anonym,

    Straight to your questions:

    1. The UpdatePanel does not parse scripts and this is well known and related to the MS AJAX Framework and not directly to RadControls - you can find more details about this as long as a workaround in teh blogpost we prepared for this and which is available below:

      http://blogs.telerik.com/tervelpeykov/posts/08-10-20/ajax_using_ajax_to_load_a_usercontrol_that_has_javascript_declared_in_it.aspx
    2. You do not need to use so complex approach to show the RadWindow from the server but better use the simpler manner which is setting VisibleOnPageLoad=true as you have done. However, I assume that this does not work in your case because of some incorrect code., e.g I am not sure how you reference the RadWindow by its name - RadWindow2 - this is not correct and you should receive an error. Please, try the following syntax:


      RadWindowManager1.Windows[0].VisibleOnPageLoad = true

      or

      RadWindowManager1.VisibleOnPageLoad = true

     

    Regards,
    Svetlina
    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.
Back to Top