protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { using (QCAstServiceClient serviceClient = new QCAstServiceClient()) { int idUser = int.Parse(Session["IdUser"].ToString()); User user = serviceClient.GetUserFromId(idUser); if (user.IdProfile != 4 & user.IdProfile != 2) { Response.Redirect("ErrorPage.aspx?Error=NotAuthorised", false); } else { ddlProfiles.DataSource = serviceClient.GetAllProfiles(); ddlProfiles.DataBind(); ddlClient.DataSource = serviceClient.GetAllClients("All", ""); ddlClient.DataBind(); lbSearchedUsers.DataSource = serviceClient.GetAllUsers("All", ""); lbSearchedUsers.DataBind(); ddlProfiles.Items.Insert(0, new ListItem("Please select..", "0")); ddlClient.Items.Insert(0, new ListItem("Please select..", "")); trButtons.Visible = false; ibDeleteUser.Enabled = false; ibEditUser.Enabled = false; } } } catch (Exception ex) { NotifyWebmasterOfError("Billing", "User Management", ex.ToString()); Response.Redirect("ErrorPage.aspx?Error=GeneralError", true); } } }