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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top