Monday, March 26, 2012

Call Webservice method which takes two paramete

Hi Everyone:

I am new to Atlas World and this is my first post.I have two question

1. I create a simple webservice which has a GetMemberDetail method as below

[

WebMethod]publicstring[] GetMemberDetail(string searchCriteria)

{

try

{

string SQL ="select member_id,first_name,last_name from table where client_id = 1111 and upper(last_name) like 'XXX%'";

SQL = SQL.Replace(

"XXX", searchCriteria.ToUpper());OracleDataReader dr =OracleHelper.ExecuteReader(cn,CommandType.Text, SQL);List<string> suggestions =newList<string>();while (dr.Read())

{

suggestions.Add(dr[2].ToString());

}

return suggestions.ToArray();

}

catch (Exception ex)

{

string mess = ex.Message.ToString();throw;

}

}

and in aspx page i have

<asp:TextBoxID="myText"runat="server"></asp:TextBox><atlas:AutoCompleteExtenderID="abc"runat="server"><atlas:AutoCompletePropertiesEnabled="true"MinimumPrefixLength="3"ServicePath="AutoCompletion.asmx"ServiceMethod="GetMemberDetail"TargetControlID="myText"/></atlas:AutoCompleteExtender>

When i run the application, parameter[searchCriteria] being passed to webservice is become a null .

Can anyone please tell if i am missing something.

Question No: 2 If i want to call a method from WebService which takes two parametes like ClientID and searchCriteria.How Can i do it ?

Please help .

Thanks,

Pargat

Hi,

regarding the AutoCompleteExtender,
1) the serviceMethod must be a method that accepts two arguments; these arguments have to be exactly named:prefixTextandcount and they must be strings. The first argument contains the text typed in the TextBox while the second is the number of results to be returned.
2) it's not possible to pass other parameters to the AutoComplete method.

Thanks .Is there any way i can use this functionality.My requirement is to pass clientID and search string [last name] and return back array that match the search criteria.

Pargat


Hi,

you can't do it at the moment with the Atlas auto-complete stuff. If I remember correctly, someone posted a custom auto-complete class that handles multiple parameters, but I think it relies on a previous Atlas release (anyway at the moment I can't find that thread).

No comments:

Post a Comment