protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Server.MapPath("~/" + "XML/album.xml"));
XmlNodeList nodelist = xmldoc.GetElementsByTagName("Album");
DataTable dt = (DataTable)Session["dt"];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < nodelist.Count; i++)
{
string val = e.CommandArgument.ToString();
string attr = nodelist[i].Attributes["Name"].Value;
if (attr == val)
{
List<string> images = new List<string>();
DirectoryInfo di = new DirectoryInfo(Server.MapPath("") + "\\Gallary\\" + val + "\\" + "Images\\");
int count = di.GetFiles().Length;
DataTable imgdt = new DataTable();
imgdt.Columns.Add("ImagesFolder", typeof(string));
for (int j = 0; j < count; j++)
{
DataRow dr = imgdt.NewRow();
string imgpath = nodelist[i].InnerText;
dr["ImagesFolder"] = nodelist[i].InnerText;
imgdt.Rows.Add(dr);
DirectoryInfo directoryInfo = new DirectoryInfo(imgpath);
FileInfo[] fileInfo = directoryInfo.GetFiles();
string fullpath = "~\\Gallary\\" + val + "\\" + "Images\\" + fileInfo[j].Name;
images.Add(fullpath);
}
Repeater2.DataSource = images;
Repeater2.DataBind();
}
}
}
}</string></string>