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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top