从数据库中检索所选值以获取复选框

时间:2018-01-03 04:32:22

标签: c# asp.net

我有以下几行代码:

newlink.aspx:

<asp:CheckBox ID="chkSend" runat="server" Text="Sent Details to User" />

newlink.aspx.cs:

command1.Parameters.AddWithValue("?sent_details", chkSend.Checked ? "1" : "0");

editlink.aspx:

<asp:CheckBox ID="chkSend" runat="server" Text="Sent Details to User" Checked='<%# Bind("sent_details") %>'/></td>

editlink.aspx.cs:

 command1.Parameters.AddWithValue("?sent_details", chkSend.Checked);

如果在Insert表单中勾选它,我没有在编辑表单中勾选复选框字段。我使用了checked.aspx中的Checked以便从数据库中获取所选值但是它没有正常工作。所以应该怎样我是为了得到选中的值ie.ticked复选框?

0 个答案:

没有答案
相关问题