Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 674
  • Last Modified:

Show "AutoComplete" suggestion list on Button Click - AJAX (ASP.NET)

Hi,

I have the following items on my web form:

1) TextBox
2) AutoCompleteExtender
3) Button

By default, if i type something in the "TextBox" then "AutoCompleteExtender" will show the suggestions. I want the suggestions list to show up when i clicked on "Button" not by default when i type in "TextBox". Can you please provide me the code for this functionality. Similary for closing the suggestion list also.

Thanks
0
milani_lucie
Asked:
milani_lucie
  • 2
  • 2
1 Solution
 
existenz2Commented:
Disable the AutoCompleteExtender by default and only enable it by setting the Enabled property when the button is clicked.
0
 
milani_lucieAuthor Commented:
Can you please provide me "JavaScript" code to do this ? Thanks
0
 
existenz2Commented:
In your aspx for the AutoCompleteExtender tag:

Enabled="False"

and in your codebehind in the event from the button:

AutoCompleteExtender1.Enabled = true;

Or better said <ID of AutoCompleteExtender>.Enabled = true;
0
 
milani_lucieAuthor Commented:
Can we do with "JavaScript" ?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now