Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
can you give me some example,please?Thank you
Posted
Updated 3-Apr-12 3:16am
v2
Comments
bbirajdar 3-Apr-12 9:59am    
Your question is unclear...So please don't expect quick answers unless you post it in a understandable manner.
ZurdoDev 3-Apr-12 10:48am    
You'll have to search google for a 3rd party control.
Sergey Alexandrovich Kryukov 3-Apr-12 13:13pm    
Who told you to use any control at all? Maybe this is a time to write some code, not waiting until someone gives you some.
--SA
Abdul Fawad 4-Apr-12 1:39am    
if you can use virtual image path method with using web Keys and in keys you can put your image folder path with name or call in your application where do you have needed!!

You'll have to search google for a 3rd party control.
 
Share this answer
 
Create A class first .Here i am assuming that your images are located in a directory called Images
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

/// <summary>
/// Summary description for PhotoManager
/// </summary>
public class PhotoManager
{
	public PhotoManager()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public FileInfo[] GetFilesInFolder() { 
    
        DirectoryInfo objP =new DirectoryInfo(HttpContext.Current. Server.MapPath("~/Images"));

        FileInfo[] objfileCollection = objP.GetFiles();

        return objfileCollection;
    }

    

        

}



Then place a Data list control on the web form : Some thing look like
ASP.NET
<asp:datalist id="DataList1" runat="server" repeatcolumns="4" xmlns:asp="#unknown">
     <itemtemplate>
         <asp:image id="Image1" runat="server" height="50px">
             ImageUrl='<%# Eval("Name","~/Images/{0}") %>' Width="50px" />
     </asp:image></itemtemplate>
 </asp:datalist>


Then place this code in the Code in aspx file:

C#
protected void Page_Load(object sender, EventArgs e)
    {
        DataList1.DataSource = new PhotoManager().GetFilesInFolder();
        DataList1.DataBind();
        

    }



I think this is you are looking
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900