I am trying to create a web service using the demo "Boosting Performance with WebServices". When I try to implement the web service, I keep getting this error.
The type Telerik.Web.UI.RadComboBoxContext is not supported because it implements IDictionary.
Does anyone know how I can get around this or what I am doing wrong from the demo?
Thanks.
The type Telerik.Web.UI.RadComboBoxContext is not supported because it implements IDictionary.
Does anyone know how I can get around this or what I am doing wrong from the demo?
Thanks.
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.Services; |
using Telerik.Web.UI; |
using System.Collections; |
using System.Runtime.Serialization; |
using System.Runtime.Serialization.Formatters.Soap; |
namespace testCombo |
{ |
/// <summary> |
/// Summary description for TestWebService |
/// </summary> |
[WebService(Namespace = "http://tempuri.org/")] |
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] |
[System.ComponentModel.ToolboxItem(false)] |
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. |
//[System.Web.Script.Services.ScriptService] |
public class TestWebService : System.Web.Services.WebService |
{ |
[WebMethod] |
public IEnumerable GetItems(RadComboBoxContext context) |
{ |
int numberOfItems = 1000; |
List<ComboBoxItemData> items = new List<ComboBoxItemData>(); |
for (int i = 0; i < numberOfItems; i++) |
{ |
ComboBoxItemData itemData = new ComboBoxItemData(); |
itemData.Text = "Item " + i; |
items.Add(itemData); |
} |
return items; |
} |
class ComboBoxItemData |
{ |
private string text; |
public string Text |
{ |
get { return text; } |
set { text = value; } |
} |
} |
} |
} |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testCombo._Default" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<telerik:RadComboBox ID="RadComboBox1" runat="server" |
EnableLoadOnDemand="true"> |
<ExpandAnimation Type="none" /> |
<CollapseAnimation Type="none" /> |
<WebServiceSettings Path="TestWebService.asmx" Method="GetItems" /> |
</telerik:RadComboBox> |
</div> |
</form> |
</body> |
</html> |