MembershipUser mu = Membership.GetUser(labelUserName.Text.Trim());//获取资格用户
try
{
bool flat = mu.ChangePassword(txtOldPassword.Text.Trim(), txtPassword.Text.Trim());
if (flat == true)
{
Response.Write("<script>alert('修改成功!');</script>");
}
else
{
Response.Write("<script>alert('修改失败!');</script>");
}
catch (Exception ex)
{
Response.Write("<script>alert('" + ex.Message.ToString() + "');</script>");
}