Solved

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

Posted on 2011-03-08
1
394 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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