vb.net 无法创建页面方法“GetCompletionList”,因为未找到 CodeBehind 或 CodeFile 文件!Ajax Visual Studio 2012
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17601118/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
cannot create page method "GetCompletionList" because no CodeBehind or CodeFile file was found! Ajax Visual Studio 2012
提问by Jason Doe
I am am in need of help with regards to the following error that I am getting when clicking on "Add AutoComplete page method" on a textbox control in an aspx page: "Cannot create page method "GetCompletionList" because no CodeBehind or CodeFile file was found!". This is related to adding an Ajax control to a webpage object such as a textbox.
我需要有关在 aspx 页面中的文本框控件上单击“添加自动完成页面方法”时出现的以下错误的帮助:“无法创建页面方法“GetCompletionList”,因为没有 CodeBehind 或 CodeFile 文件成立!”。这与将 Ajax 控件添加到网页对象(例如文本框)有关。
I have successfully added the Ajax Control Toolkit to my website toolbox in Visual Studio 2012. I have followed the following tutorial http://www.asp.net/ajaxlibrary/act_AutoC… and get the error when I get to step 4.
我已经成功地将 Ajax Control Toolkit 添加到我在 Visual Studio 2012 中的网站工具箱中。我遵循了以下教程http://www.asp.net/ajaxlibrary/act_AutoC... 并在我到达第 4 步时收到错误消息。
Any help or advice will be greatly appreciated.
任何帮助或建议将不胜感激。
Here is an extract of my code thus far:
这是迄今为止我的代码的摘录:
<asp:Content ID="Content2" ContentPlaceHolderID="rightContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<td class="tdLeftSide">Manufacturer:</td>
<td class="tdRightSide" style="width: 264px">
<%--<asp:TextBox ID="txtManufacturer" runat="server" CssClass="txtFormatting"></asp:TextBox></td>--%>
<asp:TextBox ID="txtManufacturer" runat="server" CssClass="txtFormatting"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtManufacturer_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServicePath="" TargetControlID="txtManufacturer" UseContextKey="True">
</asp:AutoCompleteExtender>
</td>
采纳答案by Karl Anderson
Manually write the code-behind and then apply the method name GetCompletionListto the ServiceMethodattribute of the extender control, like this:
手动编写代码隐藏,然后将方法名称GetCompletionList应用于ServiceMethod扩展器控件的属性,如下所示:
<asp:AutoCompleteExtender ServiceMethod="GetCompletionList" ID="txtManufacturer_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServicePath="" TargetControlID="txtManufacturer" UseContextKey="True">
</asp:AutoCompleteExtender>

