Radiobuttonlist client side event...

I'm trying to run the function activate() on the onclick event in my code behind.

Any glaring syntax errors here?

rblProj.Items(0).Attributes.Add("onclick", "activate('S');")

Thanks,
Weller0123Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
raterusConnect With a Mentor Commented:
I think you'll find that you can't do what you are after.  Try it and see, I bet that onClick stuff doesn't ever get rendered on the client.  I messed with this not too long ago and both the radiobuttonlist and the checkboxlist don't allow you to allow additional properties to the rendered listitems.  After much fuss, I ended up using a repeater.
--Michael
0
 
AerosSagaCommented:
how bout:

rblProj.Attributes.Add("onclick", "activate('S');")

Regards,

Aeros
0
 
AerosSagaCommented:
oops scratch that how bout:

rblProj.Item(0).Attributes.Add("onclick", "activate('S');")
0
 
Weller0123Author Commented:
raterus, You're right....

I'm going to use radiobuttons...

Thx...
0
 
raterusCommented:
Those work great too, I don't know why MS decided not to allow you to render additional attributes to these controls.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.