Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I want to bind dropdown list on client side. depends upon data entered in textbox.
Can anybody help me?

Thanx in advance
Posted
Comments
Thanks7872 10-Jul-13 7:02am    
I think you should have a look at google regarding what is to be done on client side and server side. See,if you take some values from textbox to dropdown list than server should be atleast aware about what has been done at client in order to perform subsequent operations.Thats why the operation can only be performed on server side. Its not possible to bind dropdown at client side,and makes nosense. Can you explain why you want to bind it like this?
Dipali_Wagh 10-Jul-13 7:08am    
bcoz on textchanged event of textbox, request goes to server and accordingly it selects data from database and then binds the dropdown list.I've set autopostback of textbox as true. So its taking time. And on VPN network its taking so much time. thats why i think it will not take that much time on client side
nikhil-vartak 10-Jul-13 8:26am    
Dipali, why don't you do this with ajax because thats the only way how you would do it on client side. Check this article: http://dotnetprof.blogspot.in/2012/12/auto-complete-textbox-using-jquery.html , although it shows auto-completer, you can use most of the code logic as is. Difference would be to bind response items to dropdown list once the ajax request is completed.
Dipali_Wagh 10-Jul-13 8:36am    
I've seen other article like this. But I want textbox and another dropdown list. becoz textbox will contain different value and drop down will contain different value
nikhil-vartak 10-Jul-13 14:51pm    
You wont be implementing what's shown in article as is. I shared that link to make you understand the logic of how you could do it. Basic flow goes like this:
1. Make ajax request to webmethod.
2. Your webmethod will have code for fetching items from database.
3. Once ajax request succeeds, you bind these items to your dropdownlist from javascript.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900