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

radalert() errror

1 Answer 106 Views
Window
This is a migrated thread and some comments may be shown as answers.
chp
Top achievements
Rank 1
chp asked on 25 Feb 2009, 02:51 PM
hi,

i always get the following error, if i want to open a popup by radalert():

Details zum Fehler auf der Webseite

Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Zeitstempel: Wed, 25 Feb 2009 14:49:39 UTC


Meldung: 'undefined' ist Null oder kein Objekt
Zeile: 9199
Zeichen: 1
Code: 0
URI: http://localhost/Webgui21/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ScriptManager_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3ade%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2008.3.1314.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3ade%3a40af2a53-a50b-4848-aa77-958f331424d9%3a16e4e7cd%3a19620875%3a1e771326%3aaa288e2d%3a874f8ea2%3a33108d14%3abd8f85e4%3bAjaxControlToolkit%2c+Version%3d1.0.20229.20821%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3ade%3ac5c982cc-4942-4683-9b48-c2c58277700f%3ab14bb7d5%3a13f47f54%3a3c55b13e


Meldung: Das Objekt unterstützt diese Eigenschaft oder Methode nicht.
Zeile: 367
Zeichen: 33
Code: 0
URI: http://localhost/webgui21/


That is my code:

                        <telerik:RadWindowManager ID="WinManager" Skin="Vista" DestroyOnClose="false" Width="400" 
                            Height="320" VisibleStatusbar="false" Behaviors="Close, Move" runat="server"
                            <Windows> 
                                <telerik:RadWindow runat="server" ID="WinContact" NavigateUrl="../Pages/Contact.aspx"
                                </telerik:RadWindow> 
                                <telerik:RadWindow runat="server" ID="WinVersion" NavigateUrl="../Pages/EngineVersion.aspx"
                                </telerik:RadWindow> 
                            </Windows> 
                        </telerik:RadWindowManager> 
                                <script type="text/javascript" language="javascript"
                                radalert('test'); 
                                </script> 

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 25 Feb 2009, 03:12 PM

Hi chp,

The controls in the RadControls for ASP.NET AJAX suite are built upon the MS AJAX framework and the framework itself creates its controls (including RadWindowManager) in the Sys.Application.add_init() method.

Here is how the client events are fired in the page life cycle:

window.onload -> Sys.Application.init -> Sys.Application.load

You can see that the client object representation of MS AJAX controls are created just as the last code on the page in the Sys.Application.init event, which is raised after the window.onload event.

That is why when you call your code in window.onload by registering the client script, the RadWindowManager will still not be created on the page and you will get an error. To avoid this problem, you can either execute your code with a small timeout, or use the Sys.Application.add_load method.

If you want to show the radalert on page load you should use code similar to the following one:

 <script type="text/javascript" language="javascript">    
                            Sys.Application.add_load(function(){radalert('test');});    
                                </script>    
 


All the best,

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.
Tags
Window
Asked by
chp
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or