1

Trying to get two checkbox controls to work with each other. Pseudo-code example:

If Checkbox 1 is checked, 
Look at checkbox 2 and make sure it is not checked.
If checkbox 2 is checked, then uncheck Checkbox 2.

and Vice Versa.

I kind of have it, but it wont update until I press a submit button. Is there a way to run the pseudo-code without pressing submit first? I tried using:

<asp:CheckBox ID="World1" runat="server" OnCheckedChanged="World1Changed" />

but in the codebehind file it still won't update without pressing submit.

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
Android Student
  • 153
  • 2
  • 12

1 Answers1

2

Just add AutoPostBack="true" to your checkbox.

whyleee
  • 4,019
  • 1
  • 31
  • 33
  • If you write like this, the experience is bad. Try to use asp.net ajax or javascript validation. – Dozer Apr 01 '12 at 09:05