public void BindGoodsDetails() { int ID = Convert.ToInt32(ViewState["GoodsID"]); DataTable dt = GoodsManager.SelectID(ID); if (dt != null && dt.Rows.Count != 0) { LVDetails.DataSource = dt; LVDetails.DataBind(); LVIntroduce.DataSource = dt; LVIntroduce.DataBind(); ViewState["Rest_num"] = dt.Rows[0]["Rest_num"].ToString(); } }
protected void LVDetails_PreRender(object sender, EventArgs e)//初始化绑定 { LVDetails.DataBind(); }