先双击UpdateButton,生成UpdateButton_Click事件
在事件中写入
TextBox TextBox1 = (TextBox)FormView3.FindControl("TextBox1");
TextBox TextBox2 = (TextBox)FormView3.FindControl("TextBox2");
TextBox TextBox3 = (TextBox)FormView3.FindControl("TextBox3");
Label Label2 = (Label)FormView3.FindControl("Label2");
if (TextBox1.Text != "" && TextBox2.Text != "" && TextBox2.Text == TextBox3.Text == true)
{
if (GetMD5(TextBox1.Text, "") == Label2.Text)
{
this.SqlDataSource3.UpdateParameters["Yu_User_Word"].DefaultValue = GetMD5(TextBox2.Text, "");
((LinkButton)FormView3.FindControl("UpdateButton")).CommandName = "Update";
return;
}
else
{
Response.Write("<script>alert('您输入的原始密码有误!');</script>");
}
}
else
{
Response.Write("<script>alert('您输入的密码不能为空!');</script>");
return;
}