The webmethod returns name and type value, i want the output to be formatted in autocomplete extender like
Name should be on left corner and TYPE should be on right corner like
Shayak Student
Nayak Teacher
Sudha Manager
<asp:TextBox ID="txtsearch" placeholder="What service do you need" ValidationGroup="search" AutoCompleteType="Disabled" runat="server" CssClass="form-control no-border" ></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteEx" runat="server" EnableCaching="false"
BehaviorID="AutoCompleteEx" MinimumPrefixLength="1" TargetControlID="txtsearch"
ServicePath="~/MyService.asmx" ServiceMethod="Search_services_v2" CompletionInterval="1000"
CompletionSetCount="20"
FirstRowSelected = "true">
</cc1:AutoCompleteExtender>
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public List<string> Search_services_v2(string prefixText, int count)
{
Entities db = new Entities();
List<string> customers = new List<string>();
var q = (from vs in db.f_vendorservice_autoserach(prefixText)
orderby vs.name
select new
{
name= vs.name,
type=vs.Type
});
foreach (var item in q)
{
string html = string.Format("{0} {1}", item.name, item.type);
customers.Add(html);
}
return customers;
}