Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Cannot create page method "GetCompletionList" because no CodeBehind or CodeFile file was found!

$
0
0

Hi,

i am trying to add autocomplete page method by right clicking on my textbox-->Add Autocomplete page method. But it is giving me error: Cannot create page method "GetCompletionList" because no CodeBehind or CodeFile file was found!. i tried to create even a sample program using the URL:http://www.asp.net/ajaxlibrary/act_AutoComplete_simple.ashx. i also tried adding the method manually but nothing is working. Please find below the code:

<div>

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<table width="100%">
<tr><td>Hiring manager</td><td>
<asp:ComboBox ID="drpManagerId" runat="server" DropDownStyle="DropDown" AutoCompleteMode="Suggest" >
</asp:ComboBox>
</td><td>Project</td><td>
<asp:TextBox runat="server" ID="txtProjects"></asp:TextBox>

<asp:AutoCompleteExtender ID="txtProjects_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True" ServicePath="~/PostJob.aspx.cs" ServiceMethod="GetProjects"
TargetControlID="txtProjects" UseContextKey="True">
</asp:AutoCompleteExtender>
</td></tr>
</table>
</div>
</form>
</body>
</html>

[System.Web.Script.Services.ScriptMethod()]
        [System.Web.Services.WebMethod]
        public static List<string> GetProjects(string prefixTxt)
        {
            List<string> retList = new List<string>();

            SQL sql = new SQL();
            DataTable dt = sql.GetProject();
            string dbValue;

            foreach (DataRow row in dt.Rows)
            {
                dbValue = row[1].ToString();
                retList.Add(dbValue);
            }
            return retList;
        }

Please help


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>