This is a migrated thread and some comments may be shown as answers.

[Solved] Server Method failed

4 Answers 283 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jyoti
Top achievements
Rank 1
Jyoti asked on 03 Aug 2009, 01:51 PM
I am using the RADcombobox for the autosuggest feature. I have a webservice with a webmethod, say, 'MyMethod' which is being used to populate the combobox with the auto suggested values.

If I type something in the Radcombobox input area, the webmethod is called. If I try to navigate away from this page by clicking any other links or buttons on this page, before the webmethod returns with values, I get an error - "Server Method MyMethod failed".

No other error messages. Please advise.

4 Answers, 1 is accepted

Sort by
0
Konzab
Top achievements
Rank 1
answered on 09 Dec 2009, 02:13 PM
Did anyone come up with a solution for this?
0
Jyoti
Top achievements
Rank 1
answered on 09 Dec 2009, 02:57 PM
Yes I did. Handle the client- side event - 'OnClientItemsRequestFailed'. 
 

<

 

telerik:RadComboBox ID=...

 

...

OnClientItemsRequestFailed

 

= "ClientItemsRequestFailed"

 


>...

</

 

telerik:RadComboBox>

 


Define a js function and write the following code in it -

 

function ClientItemsRequestFailed(sender, eventArgs)

 

{

eventArgs.set_cancel(

true);

 

// Your custom error handling if reqd.
}

0
Konzab
Top achievements
Rank 1
answered on 09 Dec 2009, 06:58 PM
Thanks for you reply. I meant were you able to get it to work (call the webservice of page method)without throwing that error.
0
Simon
Telerik team
answered on 11 Dec 2009, 12:19 PM
Hi Konzab,

You can avoid this issue by preventing the postback during a pending web service call by doing the following:
  • Handle the client-side ItemsRequesting event of the RadComboBox and set a global flag to true.
  • Handle the client-side ItemsRequested event of the RCB and set the global flag to false.
  • Handle the click events of all Buttons/Links on your page and cancel them if the flag is set to true.

Sincerely yours,
Simon
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.
Tags
ComboBox
Asked by
Jyoti
Top achievements
Rank 1
Answers by
Konzab
Top achievements
Rank 1
Jyoti
Top achievements
Rank 1
Simon
Telerik team
Share this question
or