C#中的formview中自带的edit模板不能修改数据到数据库
<EditItemTemplate>密码:<asp:TextBoxID="UpwdTextBox"runat="server"Text='<%#Bind("Upwd")%...
<EditItemTemplate>
密码:
<asp:TextBox ID="UpwdTextBox" runat="server" Text='<%# Bind("Upwd") %>' />
密保问题1:
<asp:TextBox ID="UQuestion1TextBox" runat="server"
Text='<%# Bind("UQuestion1") %>' />
答案:
<asp:TextBox ID="UAnswer1TextBox" runat="server"
Text='<%# Bind("UAnswer1") %>' />
密保问题2:
<asp:TextBox ID="UQuestion2TextBox" runat="server"
Text='<%# Bind("UQuestion2") %>' />
答案:
<asp:TextBox ID="UAnswer2TextBox" runat="server"
Text='<%# Bind("UAnswer2") %>' />
性别:
<asp:CheckBox ID="USexCheckBox" runat="server" Checked='<%# Bind("USex") %>'
Text="女" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="男"
Checked='<%# Eval("USex").ToString()=="True"?false:true %>' />
出生日期:
<asp:TextBox ID="UBirthTextBox" runat="server" Text='<%# Bind("UBirth") %>' />
Email:
<asp:TextBox ID="UEmailTextBox" runat="server" Text='<%# Bind("UEmail") %>' />
出生地点:
<asp:TextBox ID="UBirthplaceTextBox" runat="server"
Text='<%# Bind("UBirthplace") %>' />
QQ:
<asp:TextBox ID="UQQTextBox" runat="server" Text='<%# Bind("UQQ") %>' />
个性签名:
<asp:TextBox ID="USignTextBox" runat="server" Text='<%# Bind("USign") %>' />
<asp:LinkButton ID="UpdateButton" runat="server"
CommandName="Update" Text="保存"/>
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
UpdateCommand="UPDATE [User] SET [Upwd] = @Upwd, [UQuestion1] = @UQuestion1, [UAnswer1] = @UAnswer1, [UQuestion2] = @UQuestion2, [UAnswer2] = @UAnswer2, [USex] = @USex, [UBirth] = @UBirth, [UEmail] = @UEmail, [UBirthplace] = @UBirthplace, [UQQ] = @UQQ, [USign] = @USign WHERE [UNo] = @original_UNo AND [UName] = @original_UName)"> 展开
密码:
<asp:TextBox ID="UpwdTextBox" runat="server" Text='<%# Bind("Upwd") %>' />
密保问题1:
<asp:TextBox ID="UQuestion1TextBox" runat="server"
Text='<%# Bind("UQuestion1") %>' />
答案:
<asp:TextBox ID="UAnswer1TextBox" runat="server"
Text='<%# Bind("UAnswer1") %>' />
密保问题2:
<asp:TextBox ID="UQuestion2TextBox" runat="server"
Text='<%# Bind("UQuestion2") %>' />
答案:
<asp:TextBox ID="UAnswer2TextBox" runat="server"
Text='<%# Bind("UAnswer2") %>' />
性别:
<asp:CheckBox ID="USexCheckBox" runat="server" Checked='<%# Bind("USex") %>'
Text="女" />
<asp:CheckBox ID="CheckBox2" runat="server" Text="男"
Checked='<%# Eval("USex").ToString()=="True"?false:true %>' />
出生日期:
<asp:TextBox ID="UBirthTextBox" runat="server" Text='<%# Bind("UBirth") %>' />
Email:
<asp:TextBox ID="UEmailTextBox" runat="server" Text='<%# Bind("UEmail") %>' />
出生地点:
<asp:TextBox ID="UBirthplaceTextBox" runat="server"
Text='<%# Bind("UBirthplace") %>' />
QQ:
<asp:TextBox ID="UQQTextBox" runat="server" Text='<%# Bind("UQQ") %>' />
个性签名:
<asp:TextBox ID="USignTextBox" runat="server" Text='<%# Bind("USign") %>' />
<asp:LinkButton ID="UpdateButton" runat="server"
CommandName="Update" Text="保存"/>
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
UpdateCommand="UPDATE [User] SET [Upwd] = @Upwd, [UQuestion1] = @UQuestion1, [UAnswer1] = @UAnswer1, [UQuestion2] = @UQuestion2, [UAnswer2] = @UAnswer2, [USex] = @USex, [UBirth] = @UBirth, [UEmail] = @UEmail, [UBirthplace] = @UBirthplace, [UQQ] = @UQQ, [USign] = @USign WHERE [UNo] = @original_UNo AND [UName] = @original_UName)"> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询