protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int categoria = int.Parse(DropDownList1.SelectedValue);

            DataList1.DataSource = PrepararConsulta.CambiarCategoria(categoria, "", cadenaconexion);
            DataList1.DataBind();
            DataList1.SelectedIndex = -1;
        }
 protected void Button3_Click(object sender, EventArgs e)
 {
     TextBox1.Text = "";
     DropDownList1.SelectedIndex = 0;
     DataList1.DataSource        = PrepararConsulta.CambiarCategoria(0, "", cadenaconexion);
     DataList1.DataBind();
     DataList1.SelectedIndex = -1;
     alertproducto.Visible   = false;
 }
        protected void Button2_Click(object sender, EventArgs e)
        {
            String nombrep   = TextBox1.Text;
            int    categoria = int.Parse(DropDownList1.SelectedValue);

            DataList1.DataSource = PrepararConsulta.CambiarCategoria(categoria, nombrep, cadenaconexion);
            DataList1.DataBind();
            DataList1.SelectedIndex = -1;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = HttpContext.Current.User.Identity.Name;

            if (Page.IsPostBack == false)
            {
                CargarDetalle();
                lblAgregado.Text     = "";
                DataList1.DataSource = PrepararConsulta.CambiarCategoria(0, "", cadenaconexion);
                DataList1.DataBind();
            }
        }