mypwd_set.ascx.cs

来自「网上书店」· CS 代码 · 共 44 行

CS
44
字号
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class DefaultControl_Mypwd_set : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Customer"] == null)
            {
                Response.Write("<script language='javascript' type='text/javascript'>alert('你还没有登陆,请先登陆');window.location.href='Default.aspx';</script>");
            }
            else
            {
                lblUserName.Text = Session["Customer"].ToString();
                txtQuestion.Text = UserCenterAccess.GetQuestion(Session["Customer"].ToString());
            }
        }
    }
    protected void btnConfirmModify_Click(object sender, EventArgs e)
    {

        if (UserCenterAccess.ChangeQuestionAndAnswer(lblUserName.Text, txtQuestion.Text, txtAnswer.Text))
        {
            Message.ShowMsgBox(Page, "找回密码问题和答案设置成功!");

        }
        else
        {
            Message.ShowMsgBox(Page, "找回密码问题和答案设置失败!");
        }
    }
   
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?