?? editaccount.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UserInfoManage
{
/// <summary>
/// Summary description for EditAccount.
/// </summary>
public class EditAccount : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtName075;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredNameValidator075;
protected System.Web.UI.WebControls.TextBox txtPwd075;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredPwdValidator075;
protected System.Web.UI.WebControls.TextBox txtMobile075;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredMobileValidator075;
protected System.Web.UI.WebControls.TextBox txtInfo075;
protected System.Web.UI.WebControls.Button btnOK075;
protected System.Web.UI.WebControls.Button btnCancel075;
protected System.Web.UI.WebControls.ValidationSummary ValidationSummary075;
protected System.Web.UI.WebControls.RegularExpressionValidator MobileRegularExpressionValidator075;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if(!IsPostBack)
{
string name=this.Request.Form["lstUser075"];
System.Data.OleDb.OleDbDataAdapter adpt=(System.Data.OleDb.OleDbDataAdapter)this.Session["adpt"];
adpt.SelectCommand.CommandText="select * from userinfo where name='"+name+"'";
DataSet ds=new DataSet();
adpt.Fill(ds);
DataTable dt=ds.Tables["userinfo"];
DataRow row=dt.Rows[0];
string pwd=(string)row["password"];
string mobile=(string)row["mobilephone"];
string info=(string)row["remark"];
this.txtName075.Text=name;
this.txtPwd075.Text=pwd;
this.txtMobile075.Text=mobile;
this.txtInfo075.Text=info;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnOK075.Click += new System.EventHandler(this.btnOK075_Click);
this.btnCancel075.Click += new System.EventHandler(this.btnCancel075_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnOK075_Click(object sender, System.EventArgs e)
{
System.Data.OleDb.OleDbDataAdapter adpt=(System.Data.OleDb.OleDbDataAdapter)this.Session["adpt"];
DataSet ds=new DataSet();
adpt.Fill(ds);
DataTable dt=ds.Tables["userinfo"];
DataRow row=dt.Rows[0];
row["name"]=this.Request.Form["txtName075"];
row["password"]=this.Request.Form["txtPwd075"];
row["mobilephone"]=this.Request.Form["txtMobile075"];
row["remark"]=this.Request.Form["txtInfo075"];
adpt.Update(ds);
this.Server.Transfer("AdminPage.aspx");
}
private void btnCancel075_Click(object sender, System.EventArgs e)
{
this.Server.Transfer("AdminPage.aspx");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -