javascript disabled radiobutton doesn't get enabled in asp.net

S

Simon Brown

Hi,

here's the code, i have removed the irrelevent stuff

<HEAD>
<title>WebForm1</title>
<script language="javascript">
function DisableRadio()
{
document.Form1.RadioButton1.disabled = true;
}
</script>
</HEAD>
<body onload="DisableRadio()">
<asp:RadioButton id="RadioButton1" runat="server" Width="48px"
Height="42px"></asp:RadioButton>
</body>

I disable the button using DisableRadio() javascript function...
then i try to enable it using the following asp.net code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CheckBox1.Enabled = True
End Sub


it doesn't get enabled... why? Does the body_onload is called after
Page_Load??
what am i doing wrong?
 
D

DWinter

Yes, your assumption is correct. The Private Sub Page_Load is called first
to create the html to stream to the client, then the browser runs the html,
which runs the body onload event.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top