protected void DDAsignaturas_SelectedIndexChanged(object sender, EventArgs e) { System.Data.DataView dv = Session["dataview"] as System.Data.DataView; dv.RowFilter = "codigoasig ='" + DDAsignaturas.Text.ToString() + "'"; GVAsignaturas.DataSource = dv; GVAsignaturas.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { /*if (!string.IsNullOrEmpty(Session["usuario"] as string)) * { * if (Session["tipo"].ToString() != "alumno") * { * Server.Transfer("../Profesor/Profesor.aspx", true); * } * } * else * { * Response.Redirect("../Inicio.aspx"); * }*/ if (!HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority).Contains("localhost")) { log.Visible = false; } dBManager.Conectar(); if (!IsPostBack) { List <String> asignaturas = dBManager.getAsignaturasAlumno(Session["usuario"].ToString()); DDAsignaturas.DataSource = asignaturas; DDAsignaturas.DataBind(); System.Data.DataTable dt = dBManager.getTareasGenericas(Session["usuario"].ToString()).Tables[0]; System.Data.DataView dv = new System.Data.DataView(dt); dv.RowFilter = "codigoasig ='" + DDAsignaturas.Text.ToString() + "'"; Session["dataview"] = dv; GVAsignaturas.DataSource = dv; GVAsignaturas.DataBind(); } }