Click here to Skip to main content
15,885,932 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used the follwoing but the code in .aspx file is not calling webmethod of .cs file
tell me why

here is sample of .aspx file that code is not calling .cs web method

<asp:TableCell>
<asp:TextBox ID="txtDishName" runat="server"/>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtDishName"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000"
ServiceMethod="GetDishName" UseContextKey="True">





and this code in .cs file

[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
protected List<string> GetDishName(string prefixText)
{
DataSet dsObj = objFunc.getDishName(prefixText);


List<string> dishNames = new List<string>();
for (int i = 0; i < dsObj.Tables[0].Rows.Count; i++)
{
dishNames.Add(dsObj.Tables[0].Rows[i][0].ToString());
}
return dishNames;
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900