int page = 1;
            if (Request["Page"] != null)
                page = Convert.ToInt32(Request["Page"]);
            Session["CurrentPage"] = page;            string sqlcmd = "";
   int nBeginRow = Globals.RowsPerPage * (page - 1) + 1;
    if (Request.QueryString["search"] != null)
            {
              string look = "";
     if (Session["area"] != null)
               DropDownList1.Items.FindByText(Session["area"].ToString()).Selected = true;
                  if (Session["area"].ToString() != "东莞市")
                      look += " and INAREA = '" + Session["area"].ToString() + "'";
             
              if (Session["PName"] != null && Session["PName"].ToString() != "")
                  look += " and projectname like '%" + Session["PName"].ToString() + "%'";
              if (Session["PAdd"] != null && Session["PAdd"].ToString() != "")
                  look += " and address like '%" + Session["PAdd"].ToString() + "%'";
              if (Session["Company"] != null && Session["Company"].ToString() != "")
                  look += " and companyid in select t.companyid from ys_company t where t.name like '%" + Session["Company"].ToString() + "%')";
              sqlcmd = "select * from ys_projectlook where 1=1 " + look;          }
          else
          {
              Session.Remove("area");
              Session.Remove("PName");
              Session.Remove("PAdd");
              Session.Remove("Company");
              sqlcmd = "select * from ys_projectlook order by  projectid desc ";
          }          DataTable tj = D.sql(sqlcmd);
          Houses.DataSource = tj.DefaultView;
          Houses.DataBind();
        }