protected void Page_Load(object sender, EventArgs e) { string email = Convert.ToString(Session.Contents["email"]); if (!Page.IsPostBack) { //CARGAR EL DROPDOWNLIST DataView aDV = Tareas.CargarAsignaturas(email); dropAsignaturas.DataSource = aDV; dropAsignaturas.DataTextField = "codigoasig"; dropAsignaturas.DataValueField = "codigoasig"; dropAsignaturas.DataBind(); try { dropAsignaturas.SelectedValue = dropAsignaturas.Items[0].Value; //CARGAR EL GRINDVIEW SIN FILTROS DataView dv = Tareas.BuscarTareasGenericas(email, dropAsignaturas.SelectedValue); gridTareas.DataSource = dv; gridTareas.DataBind(); } catch (Exception) { } } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (Page.IsPostBack) { //CARGAR EL GRINDVIEW CON UN FILTRO DataView dv = Tareas.BuscarTareasGenericas(Convert.ToString(Session.Contents["email"]), dropAsignaturas.SelectedValue); gridTareas.DataSource = dv; gridTareas.DataBind(); } }