protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetNoStore(); //llamamos la logica y el metodo L_Ver_categorias operacion = new L_Ver_categorias(); U_Ver_categoria datos = new U_Ver_categoria(); DataTable datos_idioma = new DataTable(); Int64 idioma; if (!IsPostBack) { datos = operacion.verificar(Session["user"], Session["rolUser"]); //enviar desde la logica un codigo scrip Response.Write(datos.Url_pag); } //preguntamos si la session idioma viene vacio if (Session["idioma"] == null) { //idioma por defecto idioma = Int64.Parse("1"); datos_idioma = operacion.idioma(idioma, 7); llenar_componentes(datos_idioma); } else if (Session["idioma"] != null) { //idioma seleccionado idioma = Int64.Parse(Session["idioma"].ToString()); datos_idioma = operacion.idioma(idioma, 7); llenar_componentes(datos_idioma); } }//page_load
//----- verificar sesion ..... public U_Ver_categoria verificar(object user, object rol) { U_Ver_categoria datos = new U_Ver_categoria(); if (user == null) { datos.Url_pag = "<script type='text/javascript'>window.location=\"inicio.aspx\"</script>"; } else { if (int.Parse((String)rol) != 1 && int.Parse((String)rol) != 2) { datos.Url_pag = "<script type='text/javascript'>window.location=\"inicio.aspx\"</script>"; } } return(datos); }