Client Script for server controls..

J

Jerry Camel

Is there a way to have a server control run client side script? Seems if I
try to set an onSelectedIndexChanged event handler for an ASP dropDownList,
it won't compile. Is there a way to have some event strigger client side
script and some trigger server code? Thanks.

Jerry
 
R

Raul Macias

Let's say the name of your drop-down list is myCombo:

myCombo.Attributes.Add("onchange", "myFunction();");

where "myFunction" is the name of your client side event handler

-Raul
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top