protected void Page_Load(object sender, EventArgs e) { Repositary obj = new Repositary(); id = Convert.ToInt32(Request.QueryString["id"].ToString()); //Repositary obj=new Repositary(); if (!IsPostBack) { List <Product> L = obj.GetData(); foreach (Product P in L) { if (P.Id == id) { Image2.ImageUrl = "~//" + P.URL; Name.Text = P.Name; List <BrandItems> B = obj.GetBrand(); foreach (BrandItems BI in B) { Brands.Items.Add(new ListItem(BI.BrandName, BI.BrandId.ToString())); } price.Text = P.Price.ToString(); dec.Text = P.Description; } } } }
protected void Page_Load(object sender, EventArgs e) { Repositary r = new Repositary(); List <Product> L = r.GetData(); List <BrandItems> listofbrands = r.GetBrand(); int itemId = Convert.ToInt32(Request.QueryString["id"].ToString()); foreach (Product P in L) { if (P.Id == itemId) { Image1.ImageUrl = "~//" + P.URL; Label1.Text = P.Name; Label2.Text = P.Price.ToString(); Label3.Text = P.Description; foreach (BrandItems B in listofbrands) { if (P.Bid == B.BrandId) { Label4.Text = B.BrandName; } } } } }
protected void Page_Load(object sender, EventArgs e) { List <BrandItems> B = r.GetBrand(); foreach (BrandItems BI in B) { DropDownList1.Items.Add(new ListItem(BI.BrandName, BI.BrandId.ToString())); } }