Registering clientside events for a RadioButtonList

H

Helen

I've got some clientside script that runs when the selected index of a
select box changes. Now I need to swap my selectbox with an ASP.NET
radiobuttonlist (to solve some layout issues). I still need the
clientside script to run when the selected radio button changes, but
I'm having trouble registering onclick events with each of the radio
buttons.

I've tried registering an onclick attribute with each item:
item.Attributes["onclick"] += getJScript(hiderControl);

I've also had a look at the controls collection of the RadioButtonList
control, but there aren't any radio buttons in there when I looked
during the PreRender event.

Anyone got any ideas what I can do?

Helen
 
G

Guest

Take a look at the RegisterClientSideScript function. I think that's what
you're looking for. YOu can create your client side script as a string and
then use this function to inject it into your page.

HTH
 
B

bruce barker

the RadioButtonList does not support attaching client script server side.
you will have to attach the client script with client script. you are better
off using the html controls.

-- bruce (sqlwork.com)
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top