Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:15:44+00:00 2026-06-12T06:15:44+00:00

I want to create a gallery in asp.net the way it should work is

  • 0

I want to create a gallery in asp.net the way it should work is as follows:

  • iterate through gallery folder
  • select all the folder and show them as albums with cover pic as thumbnail.jpg in that folder
  • when clicked on the album it should display the content of the folder (images).

My approach for creating this was to iterate through the folders and make views and link button based on that for albums and to display the content of album in that view as images using repeater control, but that didn’t work out as it had many errors while implementing it. and I had to write the whole thing in on_init() function because of dynamic views.I can implement the html and js part (like for light box and other visual stuffs).
Please suggest some better approach maybe with some code example. Please use c# . Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:15:45+00:00Added an answer on June 12, 2026 at 6:15 am

    I can not just write you all the code… but ill give you a startup code:

    int scanLVL = 4;//or however deep you need to go...
    public  void GetImageFromDir(string sourceDir, int startLVL)
    {
        if (startLVL <= scanLVL)
        {
            // Here you can process files found in the directory.
            string[] fileEntries = Directory.GetFiles(sourceDir);
            Label_showdata.Text +="<br />Dir:" +  Path.GetFileName(sourceDir) ;
            foreach (string fileName in fileEntries)
            {
                // do something with fileName
                String tree = "";
                for (int i = 0; i < startLVL; i++)
                    tree += "&nbsp;&nbsp;&nbsp;";
                Label_showdata.Text += "<br />" + tree + Path.GetFileName(fileName);               
            }
    
            // Going in subdirectories of this directory.
            string[] subdirEntries = Directory.GetDirectories(sourceDir);
            foreach (string subdir in subdirEntries)
    
                if ((File.GetAttributes(subdir) &  FileAttributes.ReparsePoint) !=    FileAttributes.ReparsePoint)
    
                    GetImageFromDir(subdir, startLVL + 1);
        }
    }
    

    This will print you on your web page(actualy in that Label_showdata) all the files and the directory where they are.
    Basically from here you will need to wrap that data into a table and bind it in whatever control you feel comfortable with… Is not that hard actually… but it takes a bit more time to write exactly all the code (time that unfortunatlly i do not have at the moment…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a gallery view, in which I want to select multiple
I want to create a video gallery using Masonry on my website but I'm
I want to use this jQuery gallery more than once on my page: http://workshop.rs/2010/07/create-image-gallery-in-4-lines-of-jquery/
I want to create a gallery of pictures for my website and upload those
I want to create a gallery of pictures for my website and upload those
This is killing me! I'm using django-filebrowser, and I want to create a gallery
I want to create simple application like android image gallery but I don't want
I want to create one application which send email with attachment(select file from SD
I'm using FuelPHP to create a simple web app with a photo gallery. All
i have a question about the imgur api. I want to create a gallery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.