public void getfiles(string dir) { ddFilesDocument.Items.Clear(); Telerik.Web.UI.DropDownListItem li1 = new Telerik.Web.UI.DropDownListItem(); li1.Text = "-- select --"; li1.Value = "-1"; ddFilesDocument.Items.Add(li1); ArrayList af = new ArrayList(); string[] Filesdocument = Directory.GetFiles(dir); foreach (string filedocument in Filesdocument) { string appdir = Server.MapPath("~/App_Uploads_Docs/") + ddCatDocument.SelectedValue; string filename = filedocument.Substring(appdir.Length + 1); if ((!filename.Contains("_svn")) && (!filename.Contains(".svn"))) { if (filename.ToLower().Contains(".doc") || filename.ToLower().Contains(".zip") || filename.ToLower().Contains(".pdf") || filename.ToLower().Contains(".vcf") || filename.ToLower().Contains(".xls")) { Telerik.Web.UI.DropDownListItem li = new Telerik.Web.UI.DropDownListItem(); li.Text = filename; li.Value = filename; ddFilesDocument.Items.Add(li); } } } UpdatePanel1Document.Update(); }
private void showdocument(string folder, string file) { atagDocument.Visible = true; atagDocument.HRef = "~/App_Uploads_Docs/" + folder.Replace("\\", "/") + "/" + file; atagDocument.Title = file; UpdatePanel1Document.Update(); }
protected void ddCatDocument_SelectedIndexChanged(object sender, EventArgs e) { if (ddCatDocument.SelectedIndex > 0) { ddFilesDocument.Enabled = true; getfiles(Server.MapPath("~/App_Uploads_Docs/") + ddCatDocument.SelectedItem.Value); UpdatePanel1Document.Update(); } }
protected void getcontent() { if ((Session["catdocument"] != null) && (Session["Filesdocument"] != null)) { ddCatDocument.SelectedValue = Session["catdocument"].ToString().Replace("\\", "/"); getfiles(Server.MapPath("~/App_Uploads_Docs/") + ddCatDocument.SelectedValue); ddFilesDocument.SelectedValue = Session["Filesdocument"].ToString(); showdocument(ddCatDocument.SelectedItem.Value, ddFilesDocument.SelectedItem.Value); } UpdatePanel1Document.Update(); }