PC Review


Reply
Thread Tools Rate Thread

Adding Attributes to items in a RadioButtonList

 
 
raz
Guest
Posts: n/a
 
      24th Aug 2006
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[i].Attributes.Add("onclick","some function");
}

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

Regards,

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Attributes to items in a RadioButtonList raz Microsoft ASP .NET 0 24th Aug 2006 06:38 PM
Adding Attributes to RadioButtonList Control djarmoluk@gmail.com Microsoft ASP .NET 0 22nd Jan 2006 02:42 AM
adding attributes to radio button list <asp:radiobuttonlist .../> don't work? psb Microsoft ASP .NET 2 22nd Sep 2004 04:53 PM
Adding attributes to items in a dropdown list Joe Molloy Microsoft ASP .NET 3 18th Dec 2003 06:44 PM
Adding Attributes to RadioButtonList Items? Mike S Microsoft ASP .NET 1 15th Jul 2003 06:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 AM.