No it didn't do anything. Here is the output
<span onChange="javascript
:alert('Onchanged happened'"><input
id="RadioButton1" type="radio" name="sort" value="RadioButton1" /><label
for="RadioButton1">Ascending</label></span>
<input id="RadioButton2" type="radio" name="sort" value="RadioButton2"
/><label for="RadioButton2">Descending</label>
The onChange event is in the wrong place.
"Steve C. Orr [MVP, MCSD]" wrote:
JavaScript is Case Sensitive.
So try this:
RadioButton1.Attributes.add("onChange","javascript :alert('onChange
happened'")
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com... How do I create client events for a radio button?
Do I have to switch to HTML controls?
The code below doesn't work.
<body MS_POSITIONING="FlowLayout">
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
RadioButton1.Attributes.add("onchange","javascript :alert('Onchanged
happened'")
end sub
</script>
<form id="Form1" method="post" runat="server">
<asp:RadioButton id="RadioButton1" runat="server" GroupName="sort"
Text="Ascending"></asp:RadioButton>
<asp:RadioButton id="RadioButton2" runat="server" GroupName="sort"
Text="Descending"></asp:RadioButton>
</form>
</body>