我在formview的insertemplate和edittemplate中使用了ajax的autocompleteextender控件,它在inserttemplate中工作正常,但是当我尝试编辑内容时,它会给出如下错误:
扩展器控件“AutoCompleteExtender1”不是已注册的扩展器控件。在调用 RegisterScriptDescriptors() 之前,必须使用 RegisterExtenderControl() 注册扩展器控件。
我使用了以下代码:
<asp:FormView ID="FV1" runat="server" DefaultMode="Insert" DataKeyNames="ID" OnItemInserting="FV1_ItemInserting"
DataSourceID="sqlds1" OnDataBound="FV1_DataBound" OnItemUpdating="FV1_ItemUpdating">
<InsertItemTemplate>
<asp:Panel runat="server" ID="pnl1">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="small-blocks">
<div class="left" style="margin: 20px 10px 10px 0px;">
<img src="images/icon-plane.png" width="25" height="21" alt="" /></div>
<tr>
<td>
list
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtlist" runat="server" class="textfield-bk2" OnTextChanged="txtlist_TextChanged"
AutoPostBack="true"></asp:TextBox>
<cc1:AutoCompleteExtender ServiceMethod="Searchlist" MinimumPrefixLength="1" CompletionInterval="100"
EnableCaching="true" CompletionSetCount="10" TargetControlID="txtlist" ID="AutoCompleteExtender1"
runat="server" FirstRowSelected="true">
</cc1:AutoCompleteExtender>
</tr>
</table>
</asp:Panel>
</InsertItemTemplate>
<EditItemTemplate>
<asp:Panel runat="server" ID="pnl1">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="small-blocks">
<div class="left" style="margin: 20px 10px 10px 0px;">
<img src="images/icon-plane.png" width="25" height="21" alt="" /></div>
<tr>
<td>
list
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtlist" runat="server" class="textfield-bk2" OnTextChanged="txtFrom_TextChanged"
AutoPostBack="true"></asp:TextBox>
<cc1:AutoCompleteExtender ServiceMethod="Searchlist" MinimumPrefixLength="1" CompletionInterval="100"
EnableCaching="true" CompletionSetCount="10" TargetControlID="txtlist" ID="AutoCompleteExtender1"
runat="server" FirstRowSelected="true">
</cc1:AutoCompleteExtender>
</tr>
</table>
</asp:Panel>
</EditItemTemplate>
我应该怎么做才能解决这个问题?先感谢您。