【发布时间】:2013-05-22 08:02:29
【问题描述】:
我被指派做这个任务。我的页面包含两个文本框(用于新密码和确认)和一个保存数据的按钮。在按钮单击事件中,我首先验证两个文本框是否为空、不匹配或输入的值不符合规则。用户在两个文本框中输入正确的密码并点击保存后,此时会弹出“确认密码更改”信息。只有单击“确定”后,数据才会保存到数据库中。当用户点击取消时,数据不保存,返回false。
我在这里写我的代码:
protected void btnChangePassword_Click(object sender, EventArgs e)
{
if (txtNewPassword.Text.Trim().Length <= 0)
{
}
if (txtConfirmNewPassword.Text.Trim().Length <= 0)
{
}
if (txtNewPassword.Text.Trim() != txtConfirmNewPassword.Text.Trim())
{
}
else
{
//correct format and save the values.here i want to see a popup msg first and then click ok save values,otherwise exit..
}
}
我该怎么做?
【问题讨论】:
标签: c# javascript html asp.net