protected void Page_Load(object sender, EventArgs e) { listId = Request.QueryString["List"]; itemId = Request.QueryString["Item"]; listId = listId.Remove(0, 1); listId = listId.Remove(listId.Length - 1); var index = itemId.LastIndexOf(';'); if (index > 0) { itemId = itemId.Substring(0, index); } using (SPContext.Current.Web) { var listGuid = new Guid(listId); var list = Web.Lists[listGuid]; var folder = list.GetItemById(Convert.ToInt32(itemId)); lblFolderName.Text = folder.DisplayName; var fileFormats = new SupportedFileFormats(); foreach (var fileFormat in fileFormats.WriteFormats) { ddlFolder.Items.Add(fileFormat); } btnElip.Attributes.Add("onclick", "ShowLocationTree(" + txtDest.ClientID + "); return false;"); } }
public static bool ValidateFileFormat(SPListItem item) { string fExt = item[SPBuiltInFieldId.DocIcon].ToString().ToLower(); var fileFormats = new SupportedFileFormats(); if (fileFormats.ReadFormats.Contains(fExt)) { return(true); } return(false); }
protected DropDownList OutputFileFormats(SPListItem listItem) { var dvddl1 = new DropDownList { ID = "dvddl1", Width = 60 }; var fileFormats = new SupportedFileFormats(); var fExt = listItem[SPBuiltInFieldId.DocIcon].ToString().ToLower(); foreach (var fileFormat in fileFormats.WriteFormats.Where(fileFormat => fileFormat != fExt)) { dvddl1.Items.Add(fileFormat); } dvddl1.SelectedIndex = 0; return(dvddl1); }