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

radconfirm is not defined

10 Answers 602 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
improwise
Top achievements
Rank 1
Iron
Iron
improwise asked on 08 Apr 2011, 02:41 PM
We have a very strange problem, our site is working perfectly fine with RadConfirm/RadAlerts on one server, running Windows 7 and IIS7.5, but when we move the entire site to a Windows Server 2008 with IIS7, and run the site again (in the same webbrowser on the same computer), it will give as a javascript error "radconfirm is not defined" and then simply continue running without getting any confirm.

Any idea why this would be happening? It is the exactly same site moved to a different server, so naturally, the Telerik DLLs etc should be the same.

Here is the code we use:

    function OnClientClicking_confirm(sender, args)
    {
        debugger;
        var callBackFunction = Function.createDelegate(sender, function (argument)
        {
            if (argument)
            {
                this.click();
            }
        });
        var text = "Are you sure?";
        radconfirm(text, callBackFunction, 300, 100, null, "");
        args.set_cancel(true);
    }

10 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Apr 2011, 02:22 PM

Hello Patrik,

This is a really odd behavior. At the current state of affairs I can only be guessing, but please check whether there is a firewall or other similar software that prevents the scripts from loading.

If that is not the case please send us a live URL so we can examine the issue on our end.



Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
improwise
Top achievements
Rank 1
Iron
Iron
answered on 13 Apr 2011, 02:27 PM
Hi,

Everything is actually running on the same machine, we even tried running the webbrowser on the server to check but the symptoms are the same. We have previously seen the same problem with radalert. Unfortnately, the site is only available on an internal testserver at the moment, so giving you a URL is impossible. When we tried replacing it with normal confirm, that seemed to work. Could it be an issue with compression, optimization or similar. We've seen in a javascript debuger that all runs fine until it hits the radconfirm row, so it shouldnt be a general javascript error.
0
Marin Bratanov
Telerik team
answered on 15 Apr 2011, 08:20 AM

Hello Patrik,

It appears that the Telerik scripts are not being loaded. Please refer to the following article for more information on troubleshooting the issue: http://www.telerik.com/help/aspnet-ajax/introduction-web-resources-troubleshooting.html. The first example is shown for RadTreeView and you need to check the scripts of the RadWindowManager.

You can also try to disable the embedded scripts and load them from external files (you can find the necessary js files in your RadControls installation folder under Scripts). For more information on the matter and the necessary scripts see the following article: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html.

Yet another method is available for loading the scripts externally - that is the Telerik CDN. How to enable it is described in the following article: http://www.telerik.com/help/aspnet-ajax/radscriptmanager-cdn-support.html.



Best wishes,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
improwise
Top achievements
Rank 1
Iron
Iron
answered on 16 May 2011, 03:23 PM
Picking up on this again as we have again tried and fail to use this function. As before, this is the exact same site behaving differently on 2 different webservers (everything else works fine though, even Telerik stuff).

This will work, but produce an ugly browser dependent result:

RadAjaxManager theRadAjaxManager = RadAjaxManager.GetCurrent(Page);
theRadAjaxManager.Alert(message);

This however will not work on second server running IIS7 and give an "radalert is not defined", it will however work on an IIS 7.5 server.

string radAlert = "radalert('message', 300, 200)".Replace("message", eventLogMessage);
RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(radAlert);

Any ideas? Our code is obviously the same in both cases as the files are copied from the same source. If scripts etc would not be working at all, wouldnt we be seing this on other Telerik controls as well then?
0
Marin Bratanov
Telerik team
answered on 17 May 2011, 12:45 PM

Hello Patrik,

It is possible that the JavaScript function is called before the AJAX controls are loaded on the page and thus it is still undefined at this point. What I can suggest is to examine the followin blog post: http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx which explains how to inject JavaScript from the server side.

Another possible approach is to use the server-side RadAlert, RadConfirm and RadPrompt, which are available since Q1 2011. You can see the approach in action in the following demo: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx.

If that does not help please review your IIS and firewall settings, something from them might be blocking or delaying the loading of the necessary scripts.



Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
improwise
Top achievements
Rank 1
Iron
Iron
answered on 18 May 2011, 01:46 PM
The pages themself do work, on the IIS7.5 server, so the logic etc. shouldn't change when being moved to another server. As it doesn't work even when running the web browser on the web server. I think that we can rule out firewalls etc. Which only leaves IIS settings, or a possible incompatability between Telerik and IIS7.

As mentioned above, the server versions like RadAlert() do work, and we started using them when these problems occured. Only problem is that the provide browser depended alerts etc (an alert in IE won't look like one i Firefox etc) and we would like to get rid of this dependency.

We still have no clue on how to solve this, we have tried the ideas we could come up with? Any ideas which IIS settings could affect this? Compression? Decoding?
0
Marin Bratanov
Telerik team
answered on 20 May 2011, 07:56 AM

Hello Patrik,

At this point I can provide a few suggestions:

  • Either use the server-side RadAlert, RadConfirm and RadPrompt functions if they work as expected
  • Or try implementing the approach from the blog post (using the Sys.Application.Load event)
  • Or try adding a simple timeout to the javascript function you inject (via the setTimeout() method) so that the page has more time to load the scripts before executing the command

If trying these approaches does not yield a solution to the issue please isolate the case in a sample project and send it back to us so that we can test it in different environments. Please note that without having any information on your code, web config, etc it is very hard to say what the root cause of the issue is.



Regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
liju
Top achievements
Rank 1
answered on 19 Jul 2011, 12:20 PM
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                                                                        </telerik:RadWindowManager>
use RadWindowManager
0
Jeysson
Top achievements
Rank 1
answered on 26 Feb 2014, 03:08 AM
[quote]liju said:  <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                                                                        </telerik:RadWindowManager>
use RadWindowManager
[/quote]

This actually works! it looks like telerik doesn't load the necessary scripts for radconfirm/alert, etc. unless there is a telerik:RadWindowManager around.
0
Alfredo
Top achievements
Rank 1
answered on 03 Nov 2016, 07:07 PM
In my case the solution was to move RadWindowManager to the top of the page
Tags
Ajax
Asked by
improwise
Top achievements
Rank 1
Iron
Iron
Answers by
Marin Bratanov
Telerik team
improwise
Top achievements
Rank 1
Iron
Iron
liju
Top achievements
Rank 1
Jeysson
Top achievements
Rank 1
Alfredo
Top achievements
Rank 1
Share this question
or