private void FillCarsbyMakeModel(string Make, string Model) { var obj = new List<CarsInfo.UsedCarsInfo>(); AdsBL objAdsBL = new AdsBL(); obj = objAdsBL.GetCarsAdsMakeAndModel(); //Make , Model Session["CarAdsbyState"] = obj; rptrCarsbyState.DataSource = obj; rptrCarsbyState.DataBind(); }
public static void SetPageDefaults(Page page) { HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); DataSet dsAds = new DataSet(); if (HttpContext.Current.Cache["Ads"] == null) { AdsBL objAds = new AdsBL(); dsAds = objAds.GetAds(); HttpContext.Current.Cache["Ads"] = dsAds; } else { dsAds = (DataSet)HttpContext.Current.Cache["Ads"]; } HtmlGenericControl div88X720 = (HtmlGenericControl)page.FindControl("div88X720"); HtmlGenericControl div250X250 = (HtmlGenericControl)page.FindControl("div250X250"); HtmlGenericControl div120X600 = (HtmlGenericControl)page.FindControl("div120X600"); if (dsAds.Tables[0].Rows.Count > 0) { DataView dv = new DataView(); DataTable dt = new DataTable(); dv = dsAds.Tables[0].DefaultView; if (div88X720 != null) { dv.RowFilter = "AdName='div88X720'"; dt = dv.ToTable(); div88X720.InnerHtml= dt.Rows[0]["AdSource"].ToString() ; dv.RowFilter = ""; } if (div250X250 != null) { dv.RowFilter = "AdName='div250X250'"; dt = dv.ToTable(); div250X250.InnerHtml = dt.Rows[0]["AdSource"].ToString(); dv.RowFilter = ""; } if (div120X600 != null) { dv.RowFilter = "AdName='div120X600'"; dt = dv.ToTable(); div120X600.InnerHtml = dt.Rows[0]["AdSource"].ToString(); dv.RowFilter = ""; } } //div.InnerHtml //HtmlGenericControl , HtmlGenericControl div250X250 }
private void FillCarsbyState(string State, string city) { var obj = new List<CarsInfo.UsedCarsInfo>(); AdsBL objAdsBL = new AdsBL(); obj = objAdsBL.GetAdsByState(State, city); Session["CarAdsbyState"] = obj; rptrCarsbyState.DataSource = obj; rptrCarsbyState.DataBind(); }