asp:dropdown call client side javascript on event?

  • Thread starter Thread starter soni2926
  • Start date Start date
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.
 
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.
 
Back
Top