radconfirm is not defined

11 posts, 0 answers
  1. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 08 Apr 2011 Link to this post

    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);
        }
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 13 Apr 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 13 Apr 2011 Link to this post

    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.
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 15 Apr 2011 Link to this post

    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.

  6. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 16 May 2011 Link to this post

    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?
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 17 May 2011 Link to this post

    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.

  8. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 18 May 2011 Link to this post

    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?
  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 20 May 2011 Link to this post

    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.

  10. liju
    liju avatar
    17 posts
    Member since:
    Jul 2008

    Posted 19 Jul 2011 Link to this post

      <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                                                                            </telerik:RadWindowManager>
    use RadWindowManager
  11. Jeysson
    Jeysson avatar
    1 posts
    Member since:
    Jul 2011

    Posted 25 Feb 2014 in reply to liju Link to this post

    liju said:  <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                                                                            </telerik:RadWindowManager>
    use RadWindowManager


    This actually works! it looks like telerik doesn't load the necessary scripts for radconfirm/alert, etc. unless there is a telerik:RadWindowManager around.
  12. Alfredo
    Alfredo avatar
    2 posts
    Member since:
    Nov 2016

    Posted 03 Nov Link to this post

    In my case the solution was to move RadWindowManager to the top of the page
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017