protected void Page_Load(object sender, EventArgs e) { if ((string)Session["role"] == "Admin") { btncapnhat.Visible = false; load(); Panel1.Visible = false; if (!IsPostBack) { DropLX.DataSource = sv.DanhSachLoaiXe(); DropLX.DataTextField = "TenLoai"; DropLX.DataValueField = "MaLoai"; DropLX.DataBind(); DropNcc.DataSource = sv.DanhSachHangXe(); DropNcc.DataTextField = "TenNCC"; DropNcc.DataValueField = "MaNCC"; DropNcc.DataBind(); } } else { Response.Redirect("~/403page.aspx"); } }
void LoadDropNcc() { string sql = "select * from NhaCungCap"; DataTable data = KetNoi.Excutequerry(sql); DropNcc.DataSource = data; DropNcc.DataTextField = "TenNhaCC"; DropNcc.DataValueField = "id"; DropNcc.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { load(); if (!IsPostBack) { DropLX.DataSource = sv.DanhSachLoaiXe(); DropLX.DataTextField = "TenLoai"; DropLX.DataValueField = "MaLoai"; DropLX.DataBind(); DropNcc.DataSource = sv.DanhSachHangXe(); DropNcc.DataTextField = "TenNCC"; DropNcc.DataValueField = "MaNCC"; DropNcc.DataBind(); } }