protected void Page_Load(object sender, EventArgs e) { System.Data.DataTable allTeachers = new System.Data.DataTable(); eRegisterData.DAL oDAL1 = new eRegisterData.DAL(); try { allTeachers = oDAL1.GetActors(2); GridViewAllTeachers.DataSource = allTeachers.DefaultView; GridViewAllTeachers.DataBind(); } catch (Exception ex) { lblError.Text = "Възникнала е грешка!"; } Teachers = Request.QueryString["Teachers"]; System.Data.DataTable classList = new System.Data.DataTable(); if (Teachers != "") { try { classList = oDAL1.EditTeacherInfo(Teachers); } catch (Exception ex) { lblError.Text = "Възникнала е грешка!"; } } DetailsViewTeacherInfo.DataSource = classList.DefaultView; if (!IsPostBack) { DetailsViewTeacherInfo.DataBind(); } }
protected void GridViewAllTeachers_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridViewAllTeachers.PageIndex = e.NewPageIndex; GridViewAllTeachers.DataBind(); }