ConvincingMail - Email Marketing SoftwareConvincingMail
 
Email Marketing Software

Welcome Guest Search | Active Topics | Members | Log In | Register

Adding AutoCompleteExtender to dynamic TextBox Options · View
rsaouri
Posted: Monday, February 09, 2009 11:13:01 AM
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
trooper
Posted: Tuesday, February 10, 2009 5:58:03 AM
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
rsaouri
Posted: Wednesday, February 11, 2009 2:22:59 AM
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
trooper
Posted: Wednesday, February 11, 2009 9:16:18 AM
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
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.062 seconds.