Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello people.
I am working on a project and I am very new to asp.net.The scenario is:
There is a asp.net dropdownlist on a page. Based on the selection made in the dropdownlist control, another TextBox's content will change with no post back to the server. This must be done on the client side.
How can I do it? Can anyone guide me to a beginners tutorial?
For kind info...I am using VisualStudio2008 with .net framework 3.5
Any help will be highly appreciated.
Posted
Updated 17-Oct-11 21:54pm
v2

1 solution

This can be achieved in different ways.

1. Using javascript (purely client side)
2. Using AJAX

Take a look at the MSDN article on Working with Client-side Script[^]. Since you are new to asp.net, its worth spending sometime.

Coming to your question, set the onchange attribute in codebehind page as

ddl.Attributes["onchange"] = "javaScriptFunctoChangeTextbox();";


And you add the javascript in the aspx page.
 
Share this answer
 
Comments
Pallab_GT 22-Oct-11 23:06pm    
Hi vivek.Thanks for your help and i had my problem sorted out following the way that you have shown.
I sincerely appreciate your help.

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