This is a migrated thread and some comments may be shown as answers.
No Windows opens in UpdatePanel
3 Answers 46 Views
This is a migrated thread and some comments may be shown as answers.
anonym
Top achievements
Rank 1
anonym asked on 10 Jul 2009, 09:10 AM
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??

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 10 Jul 2009, 11:15 AM
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.
0
anonym
Top achievements
Rank 1
answered on 10 Jul 2009, 01:20 PM
 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?
0
Svetlina Anati
Telerik team
answered on 15 Jul 2009, 11:14 AM
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.
Asked by
anonym
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
anonym
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or