How to pass additional data to context from RadAutoCompleteBox
This is on my markup, the retrieval of data is working but passing the data to context from the RadAutoCompleteBox has a problem.
<
telerik:RadAutoCompleteBox
ID
=
"racbTest"
runat
=
"server"
DataTextField
=
"Text"
AutoPostBack
=
"False"
TextSettings-SelectionMode
=
"Single"
OnClientItemsRequesting
=
"TestRequesting"
InputType
=
"Text"
AllowCustomEntry
=
"True"
>
<
WebServiceSettings
Path
=
"../DataSources/DataLoader.asmx"
Method
=
"SearchTest"
>
</
WebServiceSettings
>
</
telerik:RadAutoCompleteBox
>
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
>
function TestRequesting(sender, args) {
args.get_context()["Foo"] = "Bar";
}
</
script
>
</
telerik:RadCodeBlock
>
and this is the code in the web service
[WebMethod]
public
AutoCompleteBoxData SearchTest(RadAutoCompleteContext context)
{
string
searchString = context.Text;
string
foo = context[
"Foo"
].ToString();
}
the problem is in the WebMethod, the context["Foo"] throws an error that
The given key was not present in the dictionary.
Any help would be appreciated.. Thanks in advance.