public void LoadData() { int id = Request.QueryString["id"].ToInt(0); if (id > 0) { var d = SupplierController.GetByID(id); if (d != null) { ViewState["ID"] = id; txtSupplierName.Text = d.SupplierName; pDiscountNote.Content = d.SupplierDescription; txtSupplierPhone.Text = d.SupplierPhone; txtSupplierEmail.Text = d.SupplierEmail; txtSupplierAddress.Text = d.SupplierAddress; chkIsHidden.Checked = Convert.ToBoolean(d.IsHidden); } } }