ASP.NET多个按钮button调用同一事件,如何区分是哪一button被点击
我的代码是这样的if (((Button)sender).ID == "so")
{
cond = " and 进仓编号 like " + "'%" + jcbh.Text.ToString() + "%'";
sql = "select distinct(进仓编号),仓库 from ck_进仓主表 zb inner join ck_进仓明细 mx on zb.进仓主键=mx.进仓主键" + cond;
}
if (((Button)sender).ID == "ys")
{
sql= "select distinct(进仓编号),仓库,进仓时间 from ck_进仓主表 zb inner join ck_进仓明细 mx on zb.进仓主键=mx.进仓主键 and CONVERT(varchar(100), 进仓时间, 23)=CONVERT(varchar(100), GETDATE(), 23) and 仓库='洋山'order by 进仓编号";
}
但出现问题了