Esempio n. 1
0
        protected void SearchBtn_Click(object sender, EventArgs e)
        {
            string termToSearch = SearchText.Text;

            if (!string.IsNullOrEmpty(termToSearch))
            {
                List <Author> authors         = GetAllAuthors();
                List <Author> filteredAuthors = authors.Where(author => author.AuthorName.Contains(termToSearch)).ToList();
                BookAuthors.DataSource = filteredAuthors;
                BookAuthors.DataBind();
            }
        }
Esempio n. 2
0
 private void SetDefaultDataSource()
 {
     BookAuthors.DataSource = GetAllAuthors();
     BookAuthors.DataBind();
 }