Handling/suppresing request errors

4 posts, 1 answers
  1. Carl
    Carl avatar
    20 posts
    Member since:
    Nov 2008

    Posted 11 Sep 2009 Link to this post

    Hi there,

    I have a panel that polls a web service regularly for updates. If there is some sort of communication error to the server I get a javascript error message saying that the method could not be called. Is there a way to supress this at all or capture it in some way and handle the exception manually?

    Thanks v much, Carl
  2. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 14 Sep 2009 Link to this post

    Hi Carl,

    We have added a  client event to the XmlHttpPanel (OnClientResponseError) that will be raised in case of  errors and can handle them there. If you want e.g to cancel the alert message you get for teh error and call your own custom message instead you should use the following code:

     
     function OnClientResponseError(sender, args)      
    {      
            args.set_cancelErrorAlert(true)    
            alert('My custom message here');       
    }         
       

    Let us know if you need furtehr assistance or if you have additional questions.



    All the best,

    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 16 Sep 2009 Link to this post

    Hello Svetina,

    I am using a XmlHttpPanel inside of a user control in SiteFinity. The Telerik.Web.UI.dll version is 2009.2.701.35.

    I try to use the OnClientResponseError client event described by you but it does not seem to work. This client event is not shown in the list of properties of the panel, and when I specify it anyway in the controls markup, it does not fire.

    What am I doing wrong?

    by the way, where can I get information about the event arguments? The documentation for this control is kind of incomplete.

    regards, Mikael
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 18 Sep 2009 Link to this post

    Hello Mikael,

    The mentioned event was added in the 2009.2 826 of the RadXmlHttpPanel and thus in order to use it you should upgrade to it.

    As to the arguments and their properties and methods, you can find them listed below:

    http://www.telerik.com/help/aspnet-ajax/radxmlhttppanel-client-side.html


    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top