!网站等待加载时间过长,怎么优化。ajax在这方面有优势吗
求助!网站等待加载时间过长,如何优化。ajax在这方面有优势吗?
先贴代码:
先贴代码:
public partial class list : YTPageBase
{
public int typeid = 0;
public string each = "",str = "";
public Model.SCategory catemodel = new YT.Model.SCategory();
protected List<Model.SCategory> catelist = new List<YT.Model.SCategory>();
protected List<Model.SCategory> pclist = new List<YT.Model.SCategory>();
protected List<Model.SCategory> clist = new List<YT.Model.SCategory>();
protected List<Model.SCategory> clist_z = new List<YT.Model.SCategory>();
protected List<Model.Ingredients> lists = new List<YT.Model.Ingredients>();
protected List<Model.Ingredients> list_z = new List<YT.Model.Ingredients>();
protected int xc = 0;
protected void Page_Load(object sender, EventArgs e)
{
xc = GetQueryInt("xc", 0);
typeid = GetQueryInt("tid", 0);
each = HttpUtility.UrlDecode(GetQuery("q",""));
if (typeid > 0 || each != "")
Data_z();
else
Data();
catelist = new BLLSCategory().GetModelList(" IsShow='true' and PId=0 order by SCategory_id asc ");
}
public void Data()
{
pclist = new BLLSCategory().GetModelList(" IsShow='true' and PId=0 order by SCategory_id asc");
}
public void Data_z()
{
catemodel = new BLLSCategory().GetModel(typeid);
if (catemodel == null)
{
str = " (NameCH like '%" + each + "%' or NameEN like '%" + each + "%') and IsShow='true' ";
clist_z = new BLLSCategory().GetModelList(" exists (select SType_id from Ingredients where " + str + " and SCategory_id=SType_id) order by SCategory_id asc");
}
else
{
str = " IsShow='true' ";
clist_z = new BLLSCategory().GetModelList(" PId=" + catemodel.SCategory_id + " order by SCategory_id asc");
}
}
public List<Model.SCategory> GetcateList(int pid)
{
clist = new BLLSCategory().DataTableToList(new BLLSCategory().GetTablePage(1, 3, " PId=" + pid + " and IsShow ='true'", ""));
return clist;
}
public List<Model.Ingredients> GetList(int cid)
{
lists = new BLLIngredients().DataTableToList(new BLLIngredients().GetTablePage(1, 9, " SType_id=" + cid + " and IsShow ='true'", ""));