使用delegate实现简单的查询功能

protected void imgbtnSearch_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            string keyWord = txtSearch.Text;

            tblProjectOverview.DataSource = _list.FindAll(delegate(ProjectOverviewContent content)
            {
                //返回满足结果的list
                return content.ProjectName.Contains(keyWord) || content.ServiceLine.Contains(keyWord);
            });
            tblProjectOverview.DataBind();
        }    

 

posted @ 2016-08-23 15:21  致林  阅读(206)  评论(0编辑  收藏  举报