ical Export Script Error

6 posts, 0 answers
  1. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 09 Feb Link to this post

    following the demo here - http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx

     I get a script error on ": 'demo' is undefined" on "demo.ajaxManager = $find("ctl03_RadAjaxManager1")"

    here is the script:

      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
                <script type="text/javascript">
                    /* <![CDATA[ */
                    Sys.Application.add_load(function () {
                        demo.ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                    });
                    /* ]]> */
                    (function () {
                        var demo = window.demo = window.demo || {};

                        window.Export = function (sender, e) {
                            demo.ajaxManager.__doPostBack(sender.name, "");
                        }
                    }());
                </script>
            </telerik:RadScriptBlock>

  2. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 12 Feb Link to this post

    Hi,

    I have tested the code provided and it worked correctly at my side. You may declare the demo with the following line immediately before the error line at your side to avoid it from happening:
    var demo = window.demo = window.demo || {};


    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 12 Feb in reply to Plamen Link to this post

    Hi Plamen, thank you for your reply. I added the declaration and now it fails:

     

    Unhandled exception at line 12, column 21 in script block
    0x800a138f - JavaScript runtime error: Unable to get property '__doPostBack' of undefined or null reference

     on this

     /* <![CDATA[ */
                Sys.Application.add_load(function () {
                    var demo = window.demo = window.demo || {};
                    demo.ajaxManager = $find("ctl03_RadAjaxManager1");
                });
                /* ]]> */
                (function () {
                    var demo = window.demo = window.demo || {};

                    window.Export = function (sender, e) {
                        demo.ajaxManager.__doPostBack(sender.name, "");
                    }
                }());

     

  5. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 15 Feb Link to this post

    Hi,

    I am attaching a sample page that worked correctly at my side. Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 15 Feb in reply to Plamen Link to this post

    Hi Plamen,

    So I was able to get it to work by removing the RadAjaxManagerProxy, I recall I added the RadAjaxManagerProxy to resolve another problem (http://www.telerik.com/account/support-tickets/view-ticket?threadid=961358)

    Is there a reason this should not work?

    telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

  7. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 18 Feb Link to this post

    Hi,

    It worked correctly at my side with RadAjaxManagerProxy too. I am attaching the updated page.

    Regards,
    Plamen
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017