62,025
社区成员
发帖
与我相关
我的任务
分享
protected void LinkButton1_Click(object sender, EventArgs e)
{
BindAgain();
}
void BindAgain()
{
Bind();
int id = int.Parse(Request["ID"].ToString());
string sql = "select * from MarketProduct where SecondID = '" + id + "' order by MallPrice asc";
DataView dv = Farm.DBUtility.DbHelperSQL.Query(sql).Tables[0].DefaultView;
this.DataList1.DataSource = dv;
this.DataList1.DataBind();
dv = null;
}
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="price_up" onclick="LinkButton1_Click">价格</asp:LinkButton>
protected void LinkButton1_Click(object sender, EventArgs e)
{
flag = false;
BindAgain();
}
void BindAgain()
{
int id = int.Parse(Request["ID"].ToString());
string sql = "select * from MarketProduct where SecondID = '" + id + "' order by MallPrice desc";
PagedDataSource ps = new PagedDataSource();
//int ID = Convert.ToInt32(Farm.DBUtility.DbHelperSQL.GetSingle(sql).ToString());
ps.DataSource = Farm.DBUtility.DbHelperSQL.Query(sql).Tables[0].DefaultView;
//允许分页
ps.AllowPaging = true;
ps.PageSize = AspNetPager1.PageSize;
ps.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
this.DataList1.DataSource = ps;
this.DataList1.DataKeyField = "ID";
this.DataList1.DataBind();
AspNetPager1.RecordCount = bll_pro.GetList("SecondID=" + id).Tables[0].Rows.Count;
}