可能是很简单的,记录一下,以后自己好用
protected void Page_Load(object sender, EventArgs e)
{
getSession.JuageSession();//自定义的一个检查登录状态的类
if (!Page.IsPostBack)
{
int id =Convert.ToInt32(Request["id"]);
this.ViewState["id"] = id;
string sqlexe = "select * from product where id = " + id;
SQLDbDataReader dr = userSql.db.ExecuteDataReader(sqlexe);
if (dr.Read())
{
this.title.Text = dr["title"].ToString();
this.content.Value = dr["content"].ToString();
DropBind(Convert.ToInt32(dr["parent"]));
this.ViewState["smallimg"] = dr["smallimg"];
this.ViewState["bigimg"] = dr["bigimg"];
this.ViewState["id"] = dr["id"];
this.audit.Checked = Convert.ToBoolean(dr["audit"]);
this.post.Text = dr["post"].ToString();
this.comment.Text = dr["comment"].ToString();
}
dr.Close();
dr.Dispose();
dr = null;
PageControlInt();
}
}
{
getSession.JuageSession();//自定义的一个检查登录状态的类
if (!Page.IsPostBack)
{
int id =Convert.ToInt32(Request["id"]);
this.ViewState["id"] = id;
string sqlexe = "select * from product where id = " + id;
SQLDbDataReader dr = userSql.db.ExecuteDataReader(sqlexe);
if (dr.Read())
{
this.title.Text = dr["title"].ToString();
this.content.Value = dr["content"].ToString();
DropBind(Convert.ToInt32(dr["parent"]));
this.ViewState["smallimg"] = dr["smallimg"];
this.ViewState["bigimg"] = dr["bigimg"];
this.ViewState["id"] = dr["id"];
this.audit.Checked = Convert.ToBoolean(dr["audit"]);
this.post.Text = dr["post"].ToString();
this.comment.Text = dr["comment"].ToString();
}
dr.Close();
dr.Dispose();
dr = null;
PageControlInt();
}
}