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

RadAlert CodeBehind & IE 7 - it works in firefox but not in IE

3 Answers 87 Views
Window
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 11 Feb 2009, 03:16 PM
Hi,

We are attempting to present confirmation messages using RadAlert using techniques documented here

http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind-all-versions-of-radwindow.aspx

This works in Firefox but not in IE.  My exact code for this is as follows (VB)

                    Dim radalertscript As String = "<script language='javascript'> window.onload = function(){radalert('My message here', 330, 210);}</script>"
                    Page.ClientScript.RegisterStartupScript(Me.[GetType](), "radalert", radalertscript)

Background - Telerik RadControls for ASPAJAX Q3 2008. Also, Our pages use MasterPages and in the masterpage we place a single RadScriptManager. I dont know whether this is relevant or not. If anyone has any ideas on this please help. This has been painful.




3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Feb 2009, 04:02 PM
Hi Karl,

The code that you are trying to use is for RadWindow for ASP.NET while you are actually using RadControls for ASP.NET AJAX. The main difference is that when in ASP.NET AJAX environment, all ASP.NET AJAX controls (including ours) are created on the page after it has been loaded - e.g. window.onload is fired. That is why your code is not working - it is executed in window.onload but there is still no RadWindowManager on the page that could handle the radalert function.

Please use one of the approaches that are shown in the second part of the KB that is related to RadWindow for ASP.NET AJAX. If you have any further problems, just let me know and I will be glad to help you.


Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Karl Wilkens
Top achievements
Rank 1
answered on 11 Feb 2009, 06:50 PM
Hi,

I have tried this without success. The only variance between the sample code found at
http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind-all-versions-of-radwindow.aspx
in the lower part of that kb article and our code, is that our script manager is a RadScriptManager and that is located in the masterpage, rather than in the page where we are executing our code. As you know, you can only have one script manager, so ours is in the master page.

So in code behind, we have this now -

                    Dim scriptstring As String = "radalert('a message', 330, 210);"
                    ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "radalert", scriptstring, True)


Do we need to do a findControl on the radScriptManager and use that reference or something similar? Thanks.



0
Georgi Tunev
Telerik team
answered on 16 Feb 2009, 01:34 PM
Hi Karl,

Yes, RadScriptManager should be accessed like any other control first and then you can use its methods.

If you still experience any problems with this scenario, please open a support ticket and send me a small sample project where I can examine your setup - I will check it and get back to you with the most appropriate solution right away.



All the best,
Georgi Tunev
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
Karl Wilkens
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Karl Wilkens
Top achievements
Rank 1
Share this question
or