473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Adding Attributes to items in a RadioButtonList

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[i].Attributes.Add("onclick","some function");
}

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

Regards,

Aug 24 '06 #1
0 1089

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
2
by: Mike S | last post by:
I am trying to use a RadioButtonList bound to a custom datasource to acomplish some user functionality. I want to add various onmouseover/onmouseout/onblur/onfocus events to each individual...
3
by: Janaka | last post by:
I've seen and used some samples where you can set the onclick attrubute to a Button control to get it to do some javascript a la : btnUse.Attributes = "DoSomeJS()"; However when i try and get...
4
by: tshad | last post by:
Is there a to change just one radio button in a list just after DataBinding but before send the page to the user? For example: RFPServiceTypes.DataSource =...
3
by: Peter | last post by:
Hello, One thing I am looking to do is to create a couple of different custom Web Controls that can give me added options when specifying them in an ASP.NET page. For example: ...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
0
by: djarmoluk | last post by:
I have a RadioButtonList (named rbAnswers) control within a repeater control. When binding to the repeater, I am trying to add an "OnChange" attribute to the individual list item controls (input...
0
by: raz | last post by:
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(); ...
2
by: premprakashbhati | last post by:
happy new year all of u... sir, iam using dataservice function of type int named getunbookedslots(DateTime dt) and the same is used for adding the returned datetime value to RadioButtonList of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.