Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my logic
code behind..
protected void Repeater3_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();
               BindVideo(val);
               string attr = nodelist[i].Attributes["Name"].Value;
               if (attr == val)
               {
                   List<string> videos = new List<string>();

                   XmlNodeList Videolist = xmldoc.GetElementsByTagName("VideosFolder");

                   string[] separators = { "/", "\\" };

                   if (Videolist[i] != null)
                   {
                       string videopath = Videolist[i].InnerText;
                       string[] vdowords = videopath.Split(separators, StringSplitOptions.RemoveEmptyEntries);
                       foreach (var word in vdowords)
                       {
                           Console.WriteLine(word);

                           string val1 = "\\Gallary\\";
                           string val2 = "\\Videos";
                           string val3 = val1 + word + val2;
                           bool newpath = videopath.Contains(val3);

                           if (newpath == true)
                           {
                               DirectoryInfo di = new DirectoryInfo(Server.MapPath("") + val3);
                               int count = di.GetFiles().Length;

                               DataTable imgdt = new DataTable();
                               imgdt.Columns.Add("VideosFolder", typeof(string));
                               for (int j = 0; j < count; j++)
                               {
                                   DataRow dr = imgdt.NewRow();
                                   string imgpath = Videolist[i].InnerText;
                                   //bind folder images to datarow here.
                                   dr["VideosFolder"] = Videolist[i].InnerText;
                                   imgdt.Rows.Add(dr);
                                   DirectoryInfo directoryInfo = new DirectoryInfo(imgpath);
                                   FileInfo[] fileInfo = directoryInfo.GetFiles();
                                   string fullpath = "~" + val3 + "\\" + fileInfo[j].Name;
                                   videos.Add(fullpath);//i want this path in linkbutton eval
                               }

                               Repeater3.DataSource = videos;
                               Repeater3.DataBind();
                           }
                       }
                   }
               }
           }
       }
   }




design page

XML
<asp:Repeater ID="Repeater3" runat="server" OnItemCommand="Repeater3_ItemCommand">
                           <ItemTemplate>
                               <td>
                                <%--  <div id="PlayMP4Video">

                                   </div>--%>
                                     <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument='<%#Eval("Name") %>'
                                       Text='<%#Eval("Name") %>' Height="80px" Width="120px"></asp:LinkButton>

                               </td>
                           </ItemTemplate>
                       </asp:Repeater>




can u help me please..
Posted
Updated 26-Feb-14 18:46pm
v2

1 solution

Try

XML
<%# GetPath(Eval("Name")) %>'

CS Method :

C#
protected string GetPath(Object name)
{
    // Do logic with to Add the concatenated full path and return

    return "fullPath";
}
 
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