This is a migrated thread and some comments may be shown as answers.

RadAlert on Server with RadAjaxPanel Problem

2 Answers 87 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ed Staffin
Top achievements
Rank 1
Ed Staffin asked on 15 Dec 2008, 02:00 PM
Hi,
I am using the technique described on this forum for throwing a RadAlert on the server. Namely:

Telerik.Web.UI.RadAjaxManager.GetCurrent(Me.Page)  
.ResponseScripts.Add("Sys.Application.add_load(function(){radalert('" & "Test" & "', 330, 210);})") 

This seems to work great as long as there is not a RadAjaxPanel on the page.

 
  
<form id="form1" runat="server">  
    <div> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    </telerik:RadAjaxManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    </telerik:RadWindowManager> 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">  
            <asp:Button ID="Button1" runat="server" Text="Button" /> 
        </telerik:RadAjaxPanel> 
      
    </div> 
    </form> 

If I remove the RadAjaxPanel from the code above everything works great. If I have the panel, I have to click on the button and post back twice before the alert shows. Any help would be great!
Thanks ... Ed

2 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 18 Dec 2008, 08:32 AM
Hello Ed,

I examined your code and I noticed that you are executing a script from the server by using the ResponseScripts collection of the RadAjaxManager. This operation is done i different manner depending on your scenario and I assume that in your case you do not need to attach a load handler by using the Sys.Application class. We also recently found a problem when calling predefined dialogs by using AJAX and the problem exists only under IE. We fixed it and the fix will be available in our next release which is scheduled for January.

This being said I suggest to use the following code in order to both show the alert and workaround the IE problem:

 Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page).ResponseScripts.Add("var wnd = radalert('Test', 330, 210);var a = wnd.get_contentElement().getElementsByTagName('A')[0]; a.focus();"); 
 
For your convenience I also attached a test demo. In case you need further assistance, please modify the demo in order to show your setup, open a new support ticket and send it to us along with a detailed explanation of the actual and the desired behavior.

Regards,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ed Staffin
Top achievements
Rank 1
answered on 18 Dec 2008, 12:46 PM
Tada! That did it!
Thanks so much.
Later ... Ed
Tags
Window
Asked by
Ed Staffin
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Ed Staffin
Top achievements
Rank 1
Share this question
or