I need to call a javascript function when the dropdown list is changed.
How can I implement that in asp.net?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to get function executed when element clicked, you can use above code to define a function that should be executed ‘onclick’.
But it is better to use something like
addEventListener, just search for cross-browser function (for instance, like addListener function here):Remember, than in this case you must take
DDList.ClientIDand use it as id of an element, because it will be different from ID you have set in your aspx codeBut if you need some function to be executed when actual value is changed, you should use
onchangeevent.