Exemplo n.º 1
0
        private void Mostrar(Mensajes mensaje)
        {
            string filtro = "1=1";

            if (TextBoxFiltro.Text.Length > 0)
            {
                if (DropDLFiltro.SelectedIndex == 0)
                {
                    filtro = "Id =" + TextBoxFiltro.Text;
                }
                else
                {
                    filtro = DropDLFiltro.Text + " like '%" + TextBoxFiltro.Text + "%'";
                }
            }
            else
            {
                filtro = "1=1";
            }

            GridView1.DataSource = mensaje.Listado("Id ,Nombre,Email,Asunto,Mensaje", filtro, "");
            GridView1.DataBind();
        }