Ejemplo n.º 1
0
		//		private void ddlCategories_SelectedIndexChanged(object sender, System.EventArgs e)
		//		{
		//			BindSubCategories();
		//		}

		private void btnDelete_Click(object sender, EventArgs e)
		{
			BPImages bp = new BPImages();
			BEImages.tbl_ImagesRow Image;
			
			DSImages = bp.SelectByID(ImageID);
			Image = DSImages.tbl_Images.FindByImageID(ImageID);

//			File.Delete(Server.MapPath(@"\Uploads\" + Image.ImageName));
			File.Delete(Server.MapPath(@System.Configuration.ConfigurationSettings.AppSettings["UploadsPath"] + Image.ImageName));
			 

			Image.Delete();
			bp.Update(DSImages);

			//remove all instances of this image in Products
			BPProducts bpProducts = new BPProducts();
			bpProducts.RemoveImagesByImageID(ImageID);

			Response.Redirect("BrowseImages.aspx");
		}