how do I pass additional information to the service method returning the collection of items? I'll attempt to explain what I mean, I have 2 text boxes on a form, I need to fill out names, based of a specific account id in a database. so, I need to pass an integer to the getNamesForDropDown method. I couldn't figure out what to do, so I did the wrong thing, and used the CompletionSetCount to actually pass the information I needed:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] getNamesForDropDown(string prefixText, int count)
{
String sql = "Select fldName From idAccountReps Where idAccount = " + count.ToString();
//... rest of the method removed, this should be enough code to understand
//... the evil wrongness I did.
}
in my front side aspx file, i set the CompletionSetCount based off the Account id the user is currently viewing on that page.
<ajaxtk:AutoCompleteExtender
runat="server"
ID="AC1"
TargetControlID="txtAccName"
ServiceMethod="getNamesForDropDown"
ServicePath="AccountInfo.asmx"
MinimumPrefixLength="1"
EnableCaching="true"
CompletionSetCount='<%# Eval("idAccount") %>'
/>
So, that's definitely a wrong way... what would be the right way?