Jump to content

Alterar estado de checkbox html apartir de code behind


PedroMateus

Recommended Posts

PedroMateus

Boas,

tenho uma checkbox que nao está a ser colocada a checked conforme eu quero, no page load, eu antes estava a usar um asp:checkbox e funcionava na perfeição, mas como tive que mudar para uma checkbox html começou a dar alguns problemas...se me puderem ajudar como posso alterar a checkbox era optimo, e se houver mais coisas a apontar no codigo digam

FILE.CS

string status = reader.GetValue(19).ToString();
if (status == "true") { cbBad.Checked = true; } else cbBad.Checked = false;

FILE.ASPX

<input id="cbBad" type="checkbox" onclick="if (this.checked) {putImage();}  else {removeImage();}" runat="server"/>
               

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.