Click here to Skip to main content
15,915,703 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
 <div >

  <asp:CheckBox ID="CheckBox1" runat="server" Checked="false" />  <p2> I have read the Terms and Conditions</p2>

<asp:Button ID="Button1" runat="server" Text="Next" Width="110px"/>       
  <asp:Button ID="Button2" runat="server" Text="Back"  Width="110px"/>
 
 </div>


VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Button1.Enabled = False
    If CheckBox1.Checked = True Then
        Button1.Enabled = True
    End If

End Sub
Posted
Comments
Ariel Riyo 26-Sep-12 23:12pm    
Hi michael. please elaborate the situation in your post. thanks.
Michael Portanoba 26-Sep-12 23:15pm    
as you can see. the button1 was declared false. and it should be enabled true if i checked the check box
Ariel Riyo 26-Sep-12 23:17pm    
Is your checkbox already checked when you run the site?
Michael Portanoba 26-Sep-12 23:20pm    
nope. unchecked.
Ariel Riyo 27-Sep-12 1:41am    
could you trty disabling your button in design time and not in coding?

1 solution

You should disable your button in design time or as it is in page load and place your code for the checkbox condition in the checkbox event...
 
Share this answer
 
Comments
Ariel Riyo 27-Sep-12 2:04am    
hope that helps
Michael Portanoba 27-Sep-12 2:07am    
i have tried earlier what you said. and it works fine.. thanks Mr.Ariel :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900