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

RadConfirm errors

1 Answer 95 Views
Window
This is a migrated thread and some comments may be shown as answers.
Alex Tushinsky
Top achievements
Rank 2
Alex Tushinsky asked on 23 Jul 2008, 09:10 PM
I'm creating a very simple page that calls radconfirm.  Basically, when the page loads, it is supposed to display a confirm box.  Here is the code for the page:

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">  
        </telerik:RadScriptManager> 
        <div> 
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default" 
                InitialBehavior="None" Left="" Skin="Vista" Top="">  
            </telerik:RadWindowManager> 
            <script language="javascript" type="text/javascript">  
            radconfirm('Hello', test, 330, 100);  
            function test(arg) {  
               alert('test' + arg);  
            }  
            </script> 
        </div> 
    </form> 
</body> 
</html> 

Unfortunately, the above errors out on the following line in the Telerik AXD reference:

var _e=_d._getStandardPopup("confirm",_7); 

(line 4197)

I've used this method before with the older RadControls, but it does not seem to work with 2008 (Version: 2008.1.619.20).

Does anyone have any suggestions?  It is sort of critital that I resolve this quickly, as deadlines are looming.

Thanks in advance,
Alex Tushinsky

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 24 Jul 2008, 06:51 AM
Hello Alex,

RadControls for ASP.NET AJAX are created after the page is loaded - just like any other ASP.NET AJAX control. You can check that for yourself by examining the HTML dump of the rendered page. That is why when your Javascript function is executed, the RadWindowManager is still not rendered on the page and you get the error.
What you need to do is to add your code in the Sys.Application.Load event:

Sys.Application.add_load(function() 
    radconfirm('Hello', test, 330, 100);   
}); 
function test(arg) {   
   alert('test' + arg);   
}   



All the best,
Georgi Tunev
the Telerik team

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