Home > Archive > ASP .NET > September 2004 > Registering clientside events for a RadioButtonList
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Registering clientside events for a RadioButtonList
|
|
|
| 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
| |
| ENIZIN 2004-09-30, 4:08 pm |
| 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
"Helen" wrote:
> 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
>
| |
| bruce barker 2004-09-30, 8:59 pm |
| 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)
"Helen" <helen@helephant.com> wrote in message
news:33517f44.0409300924.474c1894@posting.google.com...
> 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
|
|
|
|
|