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:
Here is the code behind for the button:
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.
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!
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> |
Private Sub LinkButton1_Click(ByVal sender As Object, ByVal 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 |
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!