I want 2 autocomplete textboxs in single aspx page. [Resolved]

Posted by Jayasugan under ASP.NET on 4/3/2013 | Points: 10 | Views : 1444 | Status : [Member] | Replies : 4
I want 2 autocomplete textboxs in single aspx page.... first autocomplete textbox is working but second textbox is not working... Is this possible???? please let me know if possible.... Thank u........

here is my Code

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="AutoComplete.asmx" />
</Services>
</asp:ToolkitScriptManager>
<asp:TextBox ID="City" runat="server" Text="" OnTextChanged="City_TextChanged" AutoPostBack="True" MaxLength="200" ></asp:TextBox>
<asp:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="City"
ServicePath="~/AutoComplete.asmx" ServiceMethod="GetCity4Txt" MinimumPrefixLength="1"
CompletionInterval="1" DelimiterCharacters=";,:" CompletionSetCount="20" EnableCaching="true" BehaviorID="AutoCompleteEx" />


<asp:TextBox ID="Area" runat="server" Text="" OnTextChanged="Area_TextChanged" AutoPostBack="True" MaxLength="200" ></asp:TextBox>
<asp:AutoCompleteExtender runat="server" ID="autoComplete2" TargetControlID="Area"
ServicePath="~/AutoComplete.asmx" ServiceMethod="Area4Txt" MinimumPrefixLength="1"
CompletionInterval="1" DelimiterCharacters=";,:" CompletionSetCount="20" EnableCaching="true" BehaviorID="AutoCompleteEx" />




Responses

Posted by: Jayakumars on: 4/3/2013 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
hi
jayasugan
try this working Good

Webservice Code
====================

[WebMethod]
public List<string> GetCountries(string prefixText)
{
List<string> CountryNames = new List<string>();
return CountryNames;
}


Client Side
======================

<asp:TextBox ID="txtCountry" runat="server"></asp:TextBox>

<asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtCountry" ServicePath="WebService.asmx"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000" ServiceMethod="GetCountries">
</asp:AutoCompleteExtender>



<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server" TargetControlID="TextBox1" ServicePath="WebService.asmx"
MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="1000" ServiceMethod="GetCountries"></asp:AutoCompleteExtender>

Mark as Answer if its helpful to you

Jayasugan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 4/3/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
refer this url
http://www.dotnetfunda.com/forums/thread14138-autocomplete-for-two-textboxs.aspx

Mark as Answer if its helpful to you

Jayasugan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayasugan on: 4/3/2013 [Member] Starter | Points: 25

Up
0
Down
Thank You For Your reply...
Sir,
All Links refered in that is for one text box I am asking for two textboxes.. can You check with my code to find my mistake..

Jayasugan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayasugan on: 4/3/2013 [Member] Starter | Points: 25

Up
0
Down
I got the answer Thank U........

Jayasugan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response