ASP.NET radiobuttonlist onclientclick

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-04-27T18:55:39Z Indexed on 2010/04/27 19:03 UTC
Read the original article Hit count: 794

Filed under:
|

I've noticed there is no OnClientClick() property for the radiobuttonlist in the ASP.NET control set. Is this a purposeful omissiong on Microsoft's part? Anyway, I've tried to add OnClick to the radio button list like so:

For Each li As ListItem In rblSearch.Items
          li.Attributes.Add("OnClick", "javascript:alert('jon');")
Next

But alas, it doesn't work. I've even checked the source in firebug, and there is no javascript shown in the radiobuttonlist. Does anyone know how to get this very simple thing working? I'm using ASP.NET control adpaters so don't know if that has anything to do with it.

(I wish asp.net/javascript would just work out the box!!!)

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript