473,473 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

AutoCompleteExtender - How to perform an event on value select

62 New Member
Hi Team

I tried a lot to get the answer but did not get it on web.

I am using an AutoCompleteExtender and getting the names fron database thru a webservice.

Now I want to select name option from the Extender and want to get the empID of that employee so that I can pass it to an ASP page as query string.

But not sure how to perform an event on selected value.

Please help!

Thanks,
Manik
Sep 4 '09 #1
7 10354
Frinavale
9,735 Recognized Expert Moderator Expert
You can't really do it on the "select" event.
Have you considered posting back to the server during the onblur JavaScript event?
Sep 4 '09 #2
Manikrag
62 New Member
Thanks Frinavale for responding.

Actully, I am trying to do the same as GOOGLE suggestion dropdown has. On selction of suggestion item, it should take you the particular suggestion link.

Can we do it thru onblur javacript?
Sep 7 '09 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Well you could fire the event when the user clicks the Enter key :)
Sep 7 '09 #4
Manikrag
62 New Member
Thanks issue resolved!!
Sep 11 '09 #5
markmark2
1 New Member
Hello

I'm trying to achieve the exact same thing, without any success. :(

Could you tell us how you did it ? (a code sample would be perfect ;) )

Thank you !
Nov 5 '09 #6
Frinavale
9,735 Recognized Expert Moderator Expert
What have you tried?
Nov 5 '09 #7
Manikrag
62 New Member
you can go thru this http://www.c-sharpcorner.com/UploadF...eExtender.aspx with an update panel and thn later on you can follow below two steps.

1. have below jscript in your head of the page where your AutoCompleteExtender is placed
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.         function Test(sender,e)
  3.         {
  4.  
  5.         __doPostBack("UpdatePanel1",sender._element.value) ;
  6.  
  7.         }
  8.  
  9.         </script>

2. Have something like this in your page_load

Expand|Select|Wrap|Line Numbers
  1.  private void Page_Load(object sender, System.EventArgs e)
  2. {
  3.         Page.RegisterHiddenField("__EVENTTARGET", "btn");
  4.         TextBox1.Attributes.Add("onkeypress", "return controlEnter('" + btn.ClientID + "', event)"); 
  5.         //btn.Focus();
  6.         TextBox1.Attributes.Add("autocomplete", "off");
  7.  
  8.         if (IsPostBack)
  9.         {
  10.  
  11.            if (Request.Form["__EVENTTARGET"] != null &&
  12.            Request.Form["__EVENTTARGET"] == "UpdatePanel1" &&
  13.             Request.Form["__EVENTARGUMENT"] != null)
  14.             {
  15.                abc = Request.Form["__EVENTARGUMENT"];
  16.         //this is the selected value - what you have selected in dropdown of AutocompleteExtender and later on you can run the query into database based on this value..in my case it was name and i fatched id thru name    
  17.            }


I hope it will help you..
Nov 6 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael Appelmans | last post by:
I have essentially copied the samplelist2.aspx from the Atlas samples but the autocomplete feature is not working in my page. The web service asmx works from a browser. Thanks for any suggestions...
11
by: =?Utf-8?B?VHJlbnQ=?= | last post by:
I have tied an AutoCompleteExtender to a textbox to indicate suggestions to the user. Everything works fine if I utilize a webservice to fetch the results. However, I want to put the web service...
0
by: KVERMEE | last post by:
I've added 2 textboxes on my page: Company and Persons Also 2 autoCompleteExtender controls (asp.net ajaxtoolkit control) to provide a list of companies and persons. When a user selects a company...
0
by: rote | last post by:
I tried using the AutoCompleteExtender sample code below but it doesn't seem to work. I'm not using a ServicePath="GetCompletionList.asmx" But the textbox doesn't return anything either does it...
1
by: shapper | last post by:
Hello, I am using an AutoCompleteExtender. I created the .asmx file with the method GetWordList: <WebMethod()_ Public Function GetWordList(ByVal prefixText As String, ByVal count As Integer)...
0
by: rote | last post by:
When i type in a word the webservice doesn't retrieve anyhthing its just blank any ideas what 'm doing wrong? My Snippet code below. In my store proc i have like below : select firstname from ...
4
by: Peter | last post by:
ASP.NET 2.0 I have an AutoCompleteExtender which works fine- I am using name, id pair in the WebService , but what I am trying to do is: once the user selects an item from the...
1
by: Jeff | last post by:
hi vs2008 The code below is some code which is being executed when user types in a textbox.. This method returns an array of strings which is shown as a dropdown list added to the listbox......
2
by: Manikrag | last post by:
Hi again I am using an AutoCompleteExtender in a user control alone with a textbox and button...On selection from auto selection dropdown or on button click event I am taking the control to next...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.