Adding Attributes to items in a RadioButtonList

R

raz

I am writing this because I have not seen an solutions to this problem.

The code below worked for me...

radio button list name = rblist

rblist.DataSource= some reader;
rblist.DataBind();

for(int i=0;i<=rblist.Items.Count-1;i++)
{
rblist.Items.Attributes.Add("onclick","some function");
}

This will add the onclick event to all items in you radio button
list...

Regards,
 

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,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top