protected void Page_Load(object sender, EventArgs e) { _role = CheckAccount(); App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); workerData = db.GetWZPersons(); if (!IsPostBack) { Calendar.SelectedDate = new DateTime(2015, 1, 1); CalendarEnd.SelectedDate = DateTime.Now.Date; Type.DataSource = _type; Type.DataBind(); From.DataSource = workerData; From.DataBind(); if (_role == "Worker") { ph1.Visible = false; ph2.Visible = true; } else { ph1.Visible = true; ph2.Visible = false; } } }