Can I make an ASP.NET AJAX AutoCompleteExtender use an ASP.NET MVC JsonResult rather than an ASMX Webservice?
I've got an ASP.NET AJAX Toolkit AutoCompleteExtender on an ASP.NET MVC View. It uses an JsonResult type function in my MVC Controller.
ASP.NET MVC View:
<form runat="server">
<asp:ScriptManager
ID="ScriptManager1"
runat="server"
EnableScriptGlobalization="true" />
<ajaxToolkit:AutoCompleteExtender
ID="autoComplete1"
runat="server"
TargetControlID="TextBox1"
ServiceMethod="find"
ServicePath="/thing"
MinimumPrefixLength="1"
CompletionInterval="1000"
EnableCaching="true"
CompletionSetCount="20"
DelimiterCharacters=";"
ShowOnlyCurrentWordInCompletionListItem="true" />
<asp:TextBox
ID="TextBox1"
runat="server" />
</form>
ASP.NET MVC Controller:
<AcceptVerbs(HttpVerbs.Post)> _
Function Find(ByVal collection As FormCollection) As JsonResult
Dim search As String = collection(0)
Dim j As New JsonResult
j.Data = ...
Return j
End Function
This fails because collection.Count is 0. Also, Request.QueryString.Count is 0.
How do I pass the typed string to my Find() function?