checkbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can i get the value of my check box? I have it based on a dataitem from
the database, but on the form the user can check it or uncheck it. How can I
determine if its checked or not and save it to the table?

I have this but its not saving:
if (checkbox1.checked == true)
{
value = 1;
}
else if (checkbox1.checked == false)
{
value = 0;
}
 
The first thing you have to do is make sure the checkbox is not being reset.
Check to make sure EnableViewState is set to true, and you are not setting it
in your Page_Load event handler (you could be rebinding it everytime... make
sure you are using !IsPostBack).

Tim
 

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

Back
Top