Hi ChetanRajakumar,
Please try the example below. In the example below, I check the file name which with string 'a', and add it for the datalist control. You can use the same code to check the file name from your database.
- <%@ Page Language="C#" AutoEventWireup="True" %>
-
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <%@ Import Namespace="System.Data" %>
- <html>
-
- <script runat="server">
-
- ICollection CreateDataSource(ArrayList files)
- {
- DataTable dt = new DataTable();
- DataRow dr;
- dt.Columns.Add(new DataColumn("FileName", typeof(String)));
- for (int i = 0; i < files.Count; i++)
- {
- dr = dt.NewRow();
- dr[0] = files[i].ToString();
- dt.Rows.Add(dr);
- }
- DataView dv = new DataView(dt);
- return dv;
- }
- protected void uploader1_UploadCompleted(object sender, UploaderEventArgs[] args)
- {
-
- ArrayList files = new ArrayList();
- for (int i = 0; i < args.Length; i++)
- {
-
- if (args[i].FileName.IndexOf("a") != -1)
- {
-
-
- files.Add(args[i].FileName);
- }
-
- }
-
- ItemsList.DataSource = CreateDataSource(files);
- ItemsList.DataBind();
- }
-
-
- </script>
-
- <body>
- <form id="Form1" runat="server">
- <CuteWebUI:Uploader ID="uploader1" runat="server" MultipleFilesUpload="true" OnUploadCompleted="uploader1_UploadCompleted" InsertText="select multiple files">
- </CuteWebUI:Uploader>
- <asp:DataList ID="ItemsList" RepeatDirection="Vertical" RepeatLayout="Table" runat="server">
- <ItemTemplate>
- file name:
- <%# DataBinder.Eval(Container.DataItem, "FileName")%>
- </ItemTemplate>
- </asp:DataList>
- </form>
- </body>
- </html>
Regards,
Ken