我正在尝试为textboxes firstname和lastname获取自动完成功能。我在这里使用Obout Textboxes。问题是,自动完成功能不适用于严格的控制,但它适用于asp.net输入类型=文本控制。
请注意,控件位于母版页中。
<script type="text/javascript">
$(document).ready(function () {
$('#<%=txtFirstName.ClientID%>').autocomplete({ source: '/Controls/AutoCompleteXHandlers/UserFirstNameXHandler.ashx', appendTo: "#firstNameContainer" });
$('#<%=txtLastName.ClientID%>').autocomplete({ source: '/Controls/AutoCompleteXHandlers/UserLastNameXHandler.ashx', appendTo: "#lastNameContainer" });
});
</script>
<div id="titleDesc" runat="server">
<p style="color: Red; text-align: left; font-weight: bold">
Please use this form to Manage the User(Contractor/Govt) Account. All questions with an '*'
are required.Enter the FirstName and LastName for the Account you wish to manage.
</p>
</div>
<br />
<br />
<div id="NewRegPage" class="dvNewRegParam" style="margin-left: 20px;" runat="server">
<table id="tblManageUser" class="tblNewRegParam">
<tr>
<td style="padding: 5px 0 6px 10px;" class="td2">
<b>*First Name</b>
</td>
<td>
<obout:OboutTextBox ID="txtFirstName" runat="server" Width="220" >
</obout:OboutTextBox>
<%-- <input id="txtFirstName" type="text" runat="server" style="width: 220px" />--%>
<div id="firstNameContainer" style="width: auto"></div>
<asp:RequiredFieldValidator ID="RFVFirstName" runat="server" ControlToValidate="txtFirstName" ValidationGroup="ManageUserAccount"
Text="*First Name is required" CssClass="error" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>