Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Radiobuttonlist client side event...

Posted on 2004-09-16
5
Medium Priority
?
536 Views
Last Modified: 2008-01-16
I'm trying to run the function activate() on the onclick event in my code behind.

Any glaring syntax errors here?

rblProj.Items(0).Attributes.Add("onclick", "activate('S');")

Thanks,
0
Comment
Question by:Weller0123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12077404
how bout:

rblProj.Attributes.Add("onclick", "activate('S');")

Regards,

Aeros
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12077437
oops scratch that how bout:

rblProj.Item(0).Attributes.Add("onclick", "activate('S');")
0
 
LVL 33

Accepted Solution

by:
raterus earned 2000 total points
ID: 12077639
I think you'll find that you can't do what you are after.  Try it and see, I bet that onClick stuff doesn't ever get rendered on the client.  I messed with this not too long ago and both the radiobuttonlist and the checkboxlist don't allow you to allow additional properties to the rendered listitems.  After much fuss, I ended up using a repeater.
--Michael
0
 

Author Comment

by:Weller0123
ID: 12077739
raterus, You're right....

I'm going to use radiobuttons...

Thx...
0
 
LVL 33

Expert Comment

by:raterus
ID: 12078314
Those work great too, I don't know why MS decided not to allow you to render additional attributes to these controls.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question