Firefox, radMenu and Webservice

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    39 posts
    Member since:
    Feb 2011

    Posted 16 Feb 2011 Link to this post

    I have a RadMenu with all items, and multiple levels of sub-items, populated by a webmethod. IE8 is perfect, and the tree is working as it should, all items are correctly fetched and placed, etc. The same goes for Firefox - as long as you take your time and allow menus to expand fully, etc, though performance is noticeably slower than in IE8.

    The problem I have is if I click on an item that has started to fetch its child items - I get an error saying that the "The server method 'xxx' failed". This only occurs in FF - IE handles cancellation of the Web method perfectly.

    I tried the following to intercept and catch any error raised in the fetch like this :
    I set  

    OnClientItemPopulationFailed="javascript:supressErrors();"

    in the RadMenu control, then included this script in the page

       <script language="javascript" type="text/javascript">
           function supressErrors(sender, eventArgs) {
               eventArgs.set_cancel(true);
           }</script>

    But in both browsers, this prevents any webservice calls, and I don't even get the > (right arrow) on the root items.

    Anyone come across this before? 
  2. Andrew
    Andrew avatar
    39 posts
    Member since:
    Feb 2011

    Posted 16 Feb 2011 Link to this post

    OK - Problem solved - my mistake - because the contents of OnClientItemPopulationFailed is used in javascript used during the set up of the controls in the page, the text for that setting needs to be 'safe'.

    OnClientItemPopulationFailed="suppressErrors"

    Gets around the problem, and fixes the Firefox issue.

Back to Top