Avoiding "The content could not be loaded" Messege

Answered (Verified) This post has 1 verified answer and 4 replies

Top 75 Contributor
Posts: 69
xmenxwk Posted: Fri Oct 30, 2009 @ 7:51 PM
I have Callback control with refresh interval, but sometimes it shows "The content could not be loaded". I know it happens because of error. But I dont want this appears even there is an error. How can I do that ? However, there is no error at all.

Answered (Verified) Verified Answer

Top 10 Contributor
Posts: 6,014
Answered (Verified) stephen Posted: Wed Dec 2, 2009 @ 8:20 AM
Verified by xmenxwk

You can trap errors using the the CallbackError client event. Add the client event and define a handler- if you want one that displays nothing at all, for example, you would just do:

 

  <script>
        function Callback_Error(sender, args) {} //trap the error; do nothing. 
    </script>

<ComponentArt:Callback runat="server" ID="Callback1" OnCallback="Callback1_Callback">
            <Content>
                <asp:Label runat="server" ID="lbl1" Text="default"></asp:Label>
            </Content>
            <ClientEvents>
                <CallbackError EventHandler="Callback_Error" />
            </ClientEvents>
        </ComponentArt:Callback>

 

 

Stephen Hatcher, Developer Support Manager

All Replies

Top 75 Contributor
Posts: 69
xmenxwk Posted: Mon Nov 2, 2009 @ 1:16 AM
damn, I posted it in Upload forum by mistake. Please move it to Callback one. ;)
Top 10 Contributor
Posts: 6,014
Answered (Verified) stephen Posted: Wed Dec 2, 2009 @ 8:20 AM
Verified by xmenxwk

You can trap errors using the the CallbackError client event. Add the client event and define a handler- if you want one that displays nothing at all, for example, you would just do:

 

  <script>
        function Callback_Error(sender, args) {} //trap the error; do nothing. 
    </script>

<ComponentArt:Callback runat="server" ID="Callback1" OnCallback="Callback1_Callback">
            <Content>
                <asp:Label runat="server" ID="lbl1" Text="default"></asp:Label>
            </Content>
            <ClientEvents>
                <CallbackError EventHandler="Callback_Error" />
            </ClientEvents>
        </ComponentArt:Callback>

 

 

Stephen Hatcher, Developer Support Manager
Top 150 Contributor
Posts: 43
jessylp Posted: Thu Jun 17, 2010 @ 6:18 PM
I think it does not help.
although there would be no message(The content could not be loaded),
it result in the callback could not run.
Top 10 Contributor
Posts: 6,014
stephen Posted: Fri Jun 18, 2010 @ 6:49 AM

If there's been an error the callback won't function, of course- the original question was just to trap the error. After you trap it you should do something useful (or determine the source of the error and correct it).

Stephen Hatcher, Developer Support Manager
Page 1 of 1 (5 items)