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

Error using RadAlert with RadAjaxManger

2 Answers 124 Views
Window
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 2
James asked on 13 Nov 2008, 04:08 PM
I am getting an error when attempting to show a RadAlert in an Ajaxified control's Try/Catch block.
Here is the code from the page:
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="LinkButton1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
        Width="75px">  
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
            style="border: 0px;" /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    </telerik:RadWindowManager> 
    <div id="left" style="float:left;width:200px">  
        <center> 
            <h3>Menu</h3> 
            <ul> 
                <li> 
                    <asp:LinkButton ID="LinkButton1" runat="server">Test RadAlert in Ajax</asp:LinkButton> 
                </li> 
            </ul> 
        </center> 
    </div> 
    <div id="content" style="float:left;width:800px">  
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="800px">  
            <asp:Label ID="lblMessage" runat="server">Main Page</asp:Label> 
        </telerik:RadAjaxPanel> 
    </div> 
    </form> 
Here is the code behind for the button:
    Private Sub LinkButton1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles LinkButton1.Click  
        Try 
            System.Threading.Thread.Sleep(3000)  
            Throw New Exception("Test of Rad Alert in Ajax")  
            Me.lblMessage.Text = "Label value changed on click of Link Button" 
        Catch ex As Exception  
            'Me.RadAjaxManager1.ResponseScripts.Add("radalert('" & ex.Message & "', 330, 210);")  
            'Me.RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function() { var f = function() { radalert('" & ex.Message & "', 330, 210, 'Test RadAlert'); Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()")  
            Me.RadAjaxManager1.ResponseScripts.Add("(function(){var f = function() { radalert('" & ex.Message & "', 330, 210, 'Test RadAlert');Sys.Application.remove_load(f);}; Sys.Application.add_load(f);})()")  
        End Try 
    End Sub 
 As you can see I have tried several ways to show the RadAlert based on threads I found on the Telerik site.  I get the following error on the first attempt to show the RadAlert, i.e. the active code.
Error message dialog box:  htmlfile: Unspecified error
With the following code hightlighted.  The line that says "_46.SetActive();" is the line of code that is highlighted.
if(_46&&_46.focus){  
window.setTimeout(function(){  
if(_46.setActive){  
_46.setActive();  
}else{  
_46.focus();  
}  
},0);  

The second choice in the Catch from the codebehind produces this error: Microsoft JScript runtime error: Object expected.

The first choice produces the exact same error as the 3rd choice.

Thanks in advance for your help with this issue!

2 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 2
answered on 17 Nov 2008, 03:53 PM
What is the normal response time for a forum post?

Thanks!
0
Svetlina Anati
Telerik team
answered on 18 Nov 2008, 09:58 AM
Hi James,

I tested the provided code with the mentioned version of RadControls - Q3 2008, namely 2008.3 1105 but I was not able to reproduce the problem. Please, examine the attached test demo, modify it in order to reproduce the problem, open a new support ticket and send it to me along with detailed reproduction instructions and explanation of the actual and the desired behavior.

As to your second question about the forum responses, they are intended to be used by the community and we do not guarantee a reply on time because support tickets have a higher priority. You can find more information about different support packages here:  http://www.telerik.com/support/technical-support-options.aspx

Regards,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
James
Top achievements
Rank 2
Answers by
James
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or