private void GrideView1Bind() { if (Request.QueryString["BLID"] != null) { DropDownList1.SelectedValue = Request.QueryString["BLID"]; GridView1.DataSource = Bll_BSCategory.Select_BLAndBS_BLID(Convert.ToInt32(Request.QueryString["BLID"])); GridView1.DataBind(); } else { GridView1.DataSource = Bll_BSCategory.Select_All(); GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["BLID"] == null) { Repeater1.DataSource = Bll_BSCategory.Select_All(); Repeater1.DataBind(); } else { Repeater1.DataSource = Bll_BSCategory.Select_BLAndBS_BLID(Convert.ToInt32(Request.QueryString["BLID"])); Repeater1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AName"] == null) { Response.Redirect("Default.aspx"); } book = Bll_Book.Select_BID(Convert.ToInt32(Request.QueryString["BID"])); if (!IsPostBack) { DropDownList1.DataSource = Bll_BSCategory.Select_All(); DropDownList1.DataValueField = "BSID"; DropDownList1.DataTextField = "BLName"; DropDownList1.DataBind(); TextBox1.Text = book.BName; TextBox5.Text = book.BAuthor; TextBox2.Text = book.BISBN; DropDownList1.SelectedValue = book.BSID.ToString(); TextBox3.Text = book.BPrice.ToString(); TextBox4.Text = book.BCount.ToString(); TextBox8.Text = book.BSaleCount.ToString(); TextBox6.Text = book.BTOC; TextBox7.Text = book.BComment; } }