By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,749 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,749 IT Pros & Developers. It's quick & easy.

<asp:checkbox>

P: n/a
C
Hi,

I have an asp server side checkbox as below.

I have a page where users can edit their user record.

I set this checkbox to true based on a value in a
database.

<asp:checkbox id="chkTest" Runat="server"></asp:checkbox>

If the user unchecks the checkbox and submits the page I
update my database.

However, when I check if it is unchecked it still says
that it is checked.

Why is this?

Thanks,
C.
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
How are you populating the checkbox? Are you checking to make sure that you
are only doing this the first time the page loads?

Show us some code...

"C" <c@nospam.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

I have an asp server side checkbox as below.

I have a page where users can edit their user record.

I set this checkbox to true based on a value in a
database.

<asp:checkbox id="chkTest" Runat="server"></asp:checkbox>

If the user unchecks the checkbox and submits the page I
update my database.

However, when I check if it is unchecked it still says
that it is checked.

Why is this?

Thanks,
C.

Nov 17 '05 #2

P: n/a
C
On submitting the page

I use the following code to check if it is checked.

If chkTest.Checked Then

-----Original Message-----
How are you populating the checkbox? Are you checking to make sure that youare only doing this the first time the page loads?

Show us some code...

"C" <c@nospam.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

I have an asp server side checkbox as below.

I have a page where users can edit their user record.

I set this checkbox to true based on a value in a
database.

<asp:checkbox id="chkTest" Runat="server"></asp:checkbox>
If the user unchecks the checkbox and submits the page I update my database.

However, when I check if it is unchecked it still says
that it is checked.

Why is this?

Thanks,
C.

.

Nov 17 '05 #3

P: n/a
C

I check by using following code.

If chkTest.Checked Then
'checked
Else
'unchecked
End If

And it is always True whether it is checked by the user
or not?
-----Original Message-----
How are you populating the checkbox? Are you checking to make sure that youare only doing this the first time the page loads?

Show us some code...

"C" <c@nospam.com> wrote in message
news:0c****************************@phx.gbl...
Hi,

I have an asp server side checkbox as below.

I have a page where users can edit their user record.

I set this checkbox to true based on a value in a
database.

<asp:checkbox id="chkTest" Runat="server"></asp:checkbox>
If the user unchecks the checkbox and submits the page I update my database.

However, when I check if it is unchecked it still says
that it is checked.

Why is this?

Thanks,
C.

.

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.