asp:dropdown call client side javascript on event?

S

soni2926

hi,
i have a asp:dropwdown list on my page, it's populated with data (via
a dataset) on page_load. when a user selects a choice i want to call
a javascript function, is this possible? to have a client side event
called by a server control?

Thanks.
 
W

Wannabe

yes...you can attach a onchange event to the dropdown, in the code behind page:

ddTitle.Attributes.Add("onclick", "MyJavascriptCall()");

or

add onclick on the HTML page, with the name of the javascript function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top