asp:RadioButton runat="server" -- how to do client-side work when clicked?

B

Barry

I've wasted the whole day trying things and researching, but nothing is
working. I would *greatly* appreciate if someone can give me the
solution to this problem.

I'm using the .NET Framework 2.0 in C# with a Master page and
additional .aspx pages with .cs code-behind pages in Windows XP.

In an .aspx page I have declared a control as follows:
<asp:RadioButton runat="server" GroupName="rbtnS0"
ID="rbtnS0start" />

I want to do some event-side work whenever this RadioButton is clicked.
I've tried everything I've found, e.g., putting
rbtnS0start.Attributes.Add("OnClick", "rbtnS0start_Click();");
in the .cs file's Page_Load event, and then specifying
<script type="javascript">
function rbtnS0start_Click()
alert('test');
</script>
in the asp:Content section of the .aspx file. I get an "error on page"
from IE6 whenever I click that button. I've tried dozens of
combinations of things. (Unfortunately, there is no OnClick attribute
for an asp:RadioButton.)

Can someone *please* give me the code (and where it goes) so that I can
do client-side work when the user clicks an asp:RadioButton control?

Thank you *so much* to anyone who helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top