473,386 Members | 1,694 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 RadioButtonList Control

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 controls of type
radio) using the following syntax:

For Each Item In rbAnswers.Items
Item.Attributes.Add("OnChange", MethodName)
Item.Enabled = False
Next

If I debug through the ItemDataBound event, "Item" is in fact a
ListItem control that represents a radio button within the rbAnswers
RadioButtonList control. However, the OnChange attribute I add is
placed in a <SPAN> tag before the <INPUT type=Radio> control thus
preventing my OnChange method from ever being called. Somehow, I need
to figure out how to get the OnChange attribute into the <INPUT>
control. Any ideas? What is strange about this is that the <INPUT>
control is disabled as desired (Item.Enabled = False).

To give some more background if it helps, I am creating an assessment
of about 40 questions generated from questions/answers in a database.
The assessment questions have dependencies such that the answer to one
question can disable/enable another question. I am creating the client
side javascript dynamically to do this. Changing an assessment response
should call the javascript which will then enable/disable a different
question.

Jan 22 '06 #1
0 1552

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...
6
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
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: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
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: ...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.