mmmk. The answer to this is that you can not use a RadioButtonList for the onMouseOver event, you need to use an individual RadioButton for the functionality you are asking for. So now comes the tricky part. If the radiobuttons in question are static, e.g. the data is not populated from a database etc, you simply can add the radio buttons to your page as you would any other server contorl:
Code:
<asp:RadioButton id="rad1" runat="server" />
<asp:RadioButton id="rad2" runat="server" />
Then, in code you would do something like:
Code:
if(!Page.IsPostBack)
{
rad1.Attributes.Add("onMouseOver", "myJSFunction()");
rad2.Attributes.Add("onMouseOver", "myJSFunction()");
}
Howerver, if the number of radiobuttons is NOT known at runtime you have to be a little bit more creative! On you .aspx page you would need some sort of container control like a placeholder or a panel and do something like: (I assume a Panel named panel1)
Code:
if(!Page.IsPostBack)
{
for(int i = 0; i < [somevalue]; i++)
{
RadioButton rad = new RadioButton();
rad.ID = i.ToString();
rad.Attributes.Add("onMouseOver", "myJSFunction()");
panel1.Controls.Add(rad);
}
}
This will give you the ability to trigger JavaScript events when a user hovers over your radiobutton.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========