void BindProduct() { if (p == null) { p = GetProduct(); } pllProduct.ProductID = p.ProductID; ltProductName.Text = p.ProductName; ltDescription.Text = "最后更新:" + p.UpdateTime.ToShortDateString() + " 关键字:" + p.ProductKeywords; ltProductCode.Text = p.ProductID.ToString();//GetString(p.ProductCode); ltProductAbstract.Text = GetString(p.ProductAbstract); BindCategory(p.ProductID); BindIndustry(p.ProductID); BindBrand(p); BindPrice(p.ProductID); // ltProductName2.Text = p.ProductName; ltBrand2.Text = string.Format("<a target=\"_blank\" href=\"{0}pages/view.aspx?product-brand&ID={1}\">{2}</a>", GlobalSettings.RelativeWebRoot, GlobalSettings.Encrypt(p.BrandID.ToString()), p.BrandName); ltPAbstract.Text = p.ProductAbstract; ltProductDetails.Text = p.ProductContent; BindProperty(p.ProductID); List <ProductModel> models = ProductModels.GetModelsByProductID(p.ProductID); if (models.Count == 0) { rbModel.Visible = false; ltModel.Text = "——"; } else { ListItem li = null; foreach (ProductModel m in models) { li = new ListItem(m.ModelName, m.ModelID.ToString()); li.Attributes.Add("title", m.ModelDesc); rbModel.Items.Add(li); } rbModel.SelectedIndex = 0; } }
void BindModels() { gvCurrentModel.DataSource = ProductModels.GetModelsByProductID(productID); gvCurrentModel.DataBind(); }