protected void Page_Load(object sender, EventArgs e) { PetStore.DB.Data oDB = new PetStore.DB.Data(); mainCategory = ""; categoryName = ""; mainCategory = Request.QueryString["MainCat"]; categoryName = Request.QueryString["Cat"]; if (mainCategory == null) { mainCategory = "DOG"; } if (categoryName == null) { categoryName = oDB.GetFirstCategoryForMainCategory(mainCategory); } DataTable dtCategories = new DataTable(); dtCategories = oDB.GetCategories(mainCategory); //, categoryName); rptLeftNav.DataSource = dtCategories; rptLeftNav.DataBind(); //string url = HttpContext.Current.Request.Url.AbsoluteUri; // http://localhost:1302/TESTERS/Default6.aspx ////home product calendar checjlist vet login, faq //if (url.Contains("dog")) { LeftStyleType = "DOG"; } //else if (url.Contains("cat")) { LeftStyleType = "CAT"; } //else if (url.Contains("fish")) { LeftStyleType = "FISH"; } //else if (url.Contains("bird")) { LeftStyleType = "BIRD"; } }
protected void Page_Load(object sender, EventArgs e) { PetStore.DB.Data oDB; oDB = new PetStore.DB.Data(); string mainCategory = ""; string categoryName = ""; mainCategory = Request.QueryString["MainCat"]; categoryName = Request.QueryString["Cat"]; if (mainCategory == null) { mainCategory = "DOG"; } if (categoryName == null) { categoryName = oDB.GetFirstCategoryForMainCategory(mainCategory); } ////if (mainCategory == "DOG") { ldog.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/dogbanner.jpg"; } ////else if (mainCategory == "CAT") { lcat.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/catbanner.jpg"; } ////else if (mainCategory == "FISH") { lfish.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/fishbanner.jpg"; } ////else if (mainCategory == "BIRD") { lbird.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/birdbanner.jpg"; } if (mainCategory == "DOG") { imgCategory.ImageUrl = "../Images/newdog.jpg"; } else if (mainCategory == "CAT") { imgCategory.ImageUrl = "../Images/newcat.png"; } else if (mainCategory == "FISH") { imgCategory.ImageUrl = "../Images/newfish.jpg"; } else if (mainCategory == "BIRD") { imgCategory.ImageUrl = "../Images/newbird.jpg"; } }
protected void Page_Load(object sender, EventArgs e) { oDB = new PetStore.DB.Data(); if (!IsPostBack) { txtError.Text = ""; if (Session["ShoppingCart"] != null) { oShoppingCartCollection = (ShoppingCartCollection)Session["ShoppingCart"]; } else { oShoppingCartCollection = new ShoppingCartCollection(); } string mainCategory = ""; string categoryName = ""; mainCategory = Request.QueryString["MainCat"]; categoryName = Request.QueryString["Cat"]; if (mainCategory == null) { mainCategory = "DOG"; } if (categoryName == null) { categoryName = oDB.GetFirstCategoryForMainCategory(mainCategory); } //if (mainCategory == "DOG") { ldog.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/dogbanner.jpg"; } //else if (mainCategory == "CAT") { lcat.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/catbanner.jpg"; } //else if (mainCategory == "FISH") { lfish.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/fishbanner.jpg"; } //else if (mainCategory == "BIRD") { lbird.Attributes.Add("class", "headerNavSelected"); imgCategory.ImageUrl = "../Images/birdbanner.jpg"; } categoryTitle.Text = oDB.GetCategoryTitle(mainCategory, categoryName); DataTable dtProduct = new DataTable(); dtProduct = oDB.GetProductByCategory(mainCategory, categoryName); rptProduct.DataSource = dtProduct; rptProduct.DataBind(); } }