Solved

How do I update/insert a checkbox value from a formview template ?

Posted on 2011-03-08
1
388 Views
Last Modified: 2012-05-11
Hi;

I am a bit confused about how to update a database boolean column.

You would normally do two way databinding for most controls except for he checkbox control.

It is my understanding is that because of the AUTOPOSTBACK property  then following code will update / create a vaule in the boolean column.

<asp:CheckBox ID="TxDueChkBox" runat="server" Checked='<%# Eval("TaxDue") %>' Text="Tax Due"  AutoPostBack="true"/>

Is this correct ?
0
Comment
Question by:gggoddard
1 Comment
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 35075527
Use Bind instead of Eval

<asp:CheckBox ID="TxDueChkBox" runat="server" Checked='<%# Bind("TaxDue") %>' Text="Tax Due"  AutoPostBack="true"/>

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now