title: Bind videos from folder in asp.net using datalist
body: <pre><code>&lt;asp:DataList ID="dtlVideos" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                       &lt;video controls="controls"  width="200" height="200" src='&lt;%# Eval ("Name","videos/{0}") %&gt;'&gt;"/&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt;
  
  public partial class videos : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              BindDataList();
          }
      }
      protected void BindDataList()
      {
          DirectoryInfo dir = new DirectoryInfo(MapPath("~/videos"));
          FileInfo[] files = dir.GetFiles();
          ArrayList listItems = new ArrayList();
          foreach (FileInfo info in files)
          {
              listItems.Add(info);
          }
          dtlVideos.DataSource = listItems;
          dtlVideos .DataBind(); 
      }
  }
  </code></pre>
  
  <p>unable to play videos in chrome  or browsers and mozilla is only supporting in .mp4 format not other formats 
  i want to make this app support all formats </p>