|
|
Rank: Newbie Groups: Member
Joined: 2/9/2009 Posts: 2 Points: 6 Location: Morocco/France
|
Hi, How can I add AutoCompleteExtender to Texbox created dynamiclly (on the fly) ? I tried client side code and server side code but no way...
Thank you so much
|
|
Rank: Administration Groups: Administration
Joined: 11/18/2007 Posts: 80 Points: 152
|
Hi rsaouri, I tried to add the textbox and the aace dynamicaly and it works fine. I used this code: Code: //dynamic textbox TextBox textBox = new TextBox(); textBox.AutoCompleteType = AutoCompleteType.None; textBox.ID = "DynamicCity"; AdvancedAutoSuggestExtender advancedAutoSuggestExtender = new AdvancedAutoSuggestExtender(); advancedAutoSuggestExtender.TargetControlID = textBox.ID; advancedAutoSuggestExtender.ServiceUrl = "~/Suggestions.asmx/CitySuggest"; advancedAutoSuggestExtender.UpdateField = "DCityTextBox"; advancedAutoSuggestExtender.ID = "DCityAASE"; advancedAutoSuggestExtender.AdditionalFields = "StateIdTextBox,CountyIdTextBox"; DynamicCityTd.Controls.Add(textBox); DynamicCityTd.Controls.Add(advancedAutoSuggestExtender);
This is the same control as used in demo for the city. Can you post your code or errors you get on your side? Thanks
|
|
Rank: Newbie Groups: Member
Joined: 2/9/2009 Posts: 2 Points: 6 Location: Morocco/France
|
Thank you for your reply. In fact, my problem is with server side TextChanged event of my dynamiclly generated TextBox : when this event is fired, the selected item in autocomplete list is replaced with the letters I typed to get this autocomplete list. Perhaps I have to do something with PostBack event ? I don't know...
Excuse me for my bad english
|
|
Rank: Administration Groups: Administration
Joined: 11/18/2007 Posts: 80 Points: 152
|
Hi, Can you post your code here or send to me via support email? Also it will be good to look at the problem in action.
Thanks
|
|
|
Guest |