Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ImageGalleryClass objImgGal = new ImageGalleryClass();
     GridView1.DataSource = objImgGal.getgallery();
     GridView1.DataBind();
 }
        protected void subAdmin(object sender, CommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Insert":
                    if (flag != 1)
                    {
                        //Creating object of LINQ Class
                        ImageGalleryClass objGallery = new ImageGalleryClass();

                        string serverPath = "~/Images/ImageGallery/".ToString();

                        string serverFileName = Path.GetFileName(Uploader.PostedFile.FileName);
                        string imageFile = serverPath + serverFileName.ToString();

                        objGallery.commitInsert(imageFile, txtFileNameI.Text);
                    }
                    else
                    {
                        flag = 0;
                    }
                    _subRebind();

                    break;

            }
        }