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(); } }
private void SetDefaultDataSource() { BookAuthors.DataSource = GetAllAuthors(); BookAuthors.DataBind(); }