protected void select_Click(object sender, EventArgs e)
{
var temp = linq.Stus.Select(s => new
{
id = s.ID,
name = s.NAME,
sex = s.Sex,
year = s.Age,
Class = s.Cla.Name
});
if (RCClas.Text.ToString() != "0")
temp = temp.Where(s => s.Class == RCClas.Text);
if (!string.IsNullOrEmpty(RTxtName.Text))
temp = temp.Where(s => s.name.Contains(RTxtName.Text));
RGStudent.DataSource = temp.ToList();
RGStudent.DataBind();
}

条件搜索单击事件不能响应
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2016-07-01 07:05关注
下断点调试,这个函数本身有没有关联给事件,也就是它有没有执行。linq.Stus本身有没有数据,两个条件是否满足。
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报