Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id_usuario = Convert.ToString(Session["id_usuario"]);

            if (id_usuario == null || id_usuario == "")
            {
                Response.Redirect("default.aspx");
            }
            else
            {
                switch (Convert.ToString(Session["rol"]))
                {
                case "Administrador":
                    usuarios.Visible = true;
                    break;

                case "Instructor":
                    usuarios.Visible = false;
                    break;

                default:
                    Response.Redirect("default.aspx");
                    break;
                }
                HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
                HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                HttpContext.Current.Response.Cache.SetNoStore();
                // Stop Caching in IE
                Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
                // Stop Caching in Firefox
                Response.Cache.SetNoStore();
                Response.Cache.AppendCacheExtension("no-cache");
                Response.Expires = 0;
                Response.Cache.SetExpires(DateTime.Now);
                Response.Cache.SetValidUntilExpires(true);
                if (!IsPostBack)
                {
                    DTOUsuario u       = new DTOUsuario();
                    CADUsuario process = new CADUsuario();
                    u.Id_u_logueado = int.Parse(id_usuario);
                    process.CargarHistorialDeUsuario(u, BulletedList1);
                }
            }
        }