Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 30, 2010 10:21 AM by Sudhanshoo Saxena
Member
30 Points
47 Posts
Nov 13, 2009 08:45 AM|LINK
What are the other methods supported by the behavior object? Is there a method to activate the control on load or at any other time from the javascript?
19 Points
12 Posts
Mar 29, 2010 06:04 PM|LINK
I need to have the contextKey determined by a TextBox. I am trying the approach by kirtid.
function AutoCompleteContextKeys() { var autoComplete = $find('autoCompleteState'); var autoComplete2 = document.getElementById('<%= this.autoCompleteState.ClientID %>'); if (autoComplete == null) alert("autoComplete is null"); if (autoComplete2 == null) alert("autoComplete2 is null"); if (!autoComplete) return; var target = autoComplete.get_element(); if (!target) return; var userContext = $get('edtCountry'); if (!userContext) return; // Dynamically assign the context autoComplete.add_populating( function() { autoComplete.set_contextKey(userContext.value); }); } addLoadEvent(AutoCompleteContextKeys); ... <asp:TextBox runat="server" ID="edtState" CssClass="EditBox" Width="350px" /> <ajax:AutoCompleteExtender ID="autoCompleteState" runat="server" ServiceMethod="State" ServicePath="../../API/AutoComplete.asmx" TargetControlID="edtState" MinimumPrefixLength="1" CompletionInterval="250" EnableCaching="true" CompletionSetCount="20" FirstRowSelected="true" UseContextKey="true" CompletionListCssClass="AutoComplete_List ACL_Width200" CompletionListItemCssClass="AutoComplete_Item" CompletionListHighlightedItemCssClass="AutoComplete_ItemSelected"></ajax:AutoCompleteExtender> <asp:TextBox runat="server" ID="edtCountry" CssClass="EditBox" Width="350px" />
Both autoComplete and autoComplete2 are null.
What am I doing wrong?
12 Points
7 Posts
Jul 19, 2010 12:02 PM|LINK
protected void ADVID_Changed(object sender, EventArgs e) { //AjaxControlToolkit.AutoCompleteExtender filtro = new AjaxControlToolkit.AutoCompleteExtender(); AjaxControlToolkit.AutoCompleteExtender filtro = (AjaxControlToolkit.AutoCompleteExtender)this.FV_HDR.FindControl("AutoCompleteExtender_ACCTID"); TextBox t1 = (TextBox)this.FV_HDR.FindControl("ADVIDTextBox"); filtro.ContextKey = t1.Text; }
what is FV_HDR,
Jul 19, 2010 12:04 PM|LINK
what is FV_HDR , i really want thisa code
2 Points
1 Post
Jul 30, 2010 10:21 AM|LINK
i put form in place of FV_HDR and its give me Desire result, Thanks a lot
a_shyam41
Member
30 Points
47 Posts
Re: Adding Textbox-Value to ContextKey of Autocomplete control
Nov 13, 2009 08:45 AM|LINK
What are the other methods supported by the behavior object? Is there a method to activate the control on load or at any other time from the javascript?
SangNaga
Member
19 Points
12 Posts
Re: Adding Textbox-Value to ContextKey of Autocomplete control
Mar 29, 2010 06:04 PM|LINK
I need to have the contextKey determined by a TextBox. I am trying the approach by kirtid.
function AutoCompleteContextKeys() { var autoComplete = $find('autoCompleteState'); var autoComplete2 = document.getElementById('<%= this.autoCompleteState.ClientID %>'); if (autoComplete == null) alert("autoComplete is null"); if (autoComplete2 == null) alert("autoComplete2 is null"); if (!autoComplete) return; var target = autoComplete.get_element(); if (!target) return; var userContext = $get('edtCountry'); if (!userContext) return; // Dynamically assign the context autoComplete.add_populating( function() { autoComplete.set_contextKey(userContext.value); }); } addLoadEvent(AutoCompleteContextKeys); ... <asp:TextBox runat="server" ID="edtState" CssClass="EditBox" Width="350px" /> <ajax:AutoCompleteExtender ID="autoCompleteState" runat="server" ServiceMethod="State" ServicePath="../../API/AutoComplete.asmx" TargetControlID="edtState" MinimumPrefixLength="1" CompletionInterval="250" EnableCaching="true" CompletionSetCount="20" FirstRowSelected="true" UseContextKey="true" CompletionListCssClass="AutoComplete_List ACL_Width200" CompletionListItemCssClass="AutoComplete_Item" CompletionListHighlightedItemCssClass="AutoComplete_ItemSelected"></ajax:AutoCompleteExtender> <asp:TextBox runat="server" ID="edtCountry" CssClass="EditBox" Width="350px" />imranm
Member
12 Points
7 Posts
Re: Adding Textbox-Value to ContextKey of Autocomplete control
Jul 19, 2010 12:02 PM|LINK
protected void ADVID_Changed(object sender, EventArgs e)
{
//AjaxControlToolkit.AutoCompleteExtender filtro = new AjaxControlToolkit.AutoCompleteExtender();
AjaxControlToolkit.AutoCompleteExtender filtro = (AjaxControlToolkit.AutoCompleteExtender)this.FV_HDR.FindControl("AutoCompleteExtender_ACCTID");
TextBox t1 = (TextBox)this.FV_HDR.FindControl("ADVIDTextBox");
filtro.ContextKey = t1.Text;
}
what is FV_HDR,
imranm
Member
12 Points
7 Posts
Re: Adding Textbox-Value to ContextKey of Autocomplete control
Jul 19, 2010 12:04 PM|LINK
protected void ADVID_Changed(object sender, EventArgs e)
{
//AjaxControlToolkit.AutoCompleteExtender filtro = new AjaxControlToolkit.AutoCompleteExtender();
AjaxControlToolkit.AutoCompleteExtender filtro = (AjaxControlToolkit.AutoCompleteExtender)this.FV_HDR.FindControl("AutoCompleteExtender_ACCTID");
TextBox t1 = (TextBox)this.FV_HDR.FindControl("ADVIDTextBox");
filtro.ContextKey = t1.Text;
}
what is FV_HDR , i really want thisa code
Sudhanshoo S...
Member
2 Points
1 Post
Re: Adding Textbox-Value to ContextKey of Autocomplete control
Jul 30, 2010 10:21 AM|LINK
i put form in place of FV_HDR and its give me Desire result, Thanks a lot