aspx page
<td>
<asp:TextBox CssClass="textbox_size" ID="txtspz" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="ace_spzname" runat="server" TargetControlID="txtspz"
ServiceMethod="GetSpzList" MinimumPrefixLength="1" ServicePath="~/WebService/WebService1.asmx"
EnableCaching="true" ShowOnlyCurrentWordInCompletionListItem="true" DelimiterCharacters=";,:"
CompletionSetCount="5" CompletionInterval="0" FirstRowSelected="true" CompletionListCssClass="autocomplete"
CompletionListElementID="divwidth">
</cc1:AutoCompleteExtender>
</td>
<asp:Button ID="btnsubmit" OnClick="submit_btnclick" runat="server" Text="Submit" />
asmx.cs (use web service)
[WebMethod]
public string[] GetSpzList(string prefixText, int count)
{
using (DataClasses1DataContext dc = new DataClasses1DataContext())
{
var search = (from n in dc.Specialization where n.Name.Contains(prefixText) select n.Name).ToArray();
return search;
}
}
cs page
protected void submit_btnclick(object sender, EventArgs e)
{
string Gettext;
Gettext = txtspz.text;
}