private bool UploadAndImportExcelFile() { if (excelFileUpload.HasFile) { ClearUploadedSheets(); // Parse and read data from excel file try { ExcelParser parser = new ExcelParser(excelFileUpload.FileContent, excelFileUpload.FileName); Workbook workbook = parser.GetWorkBook(); UploadedSheets = GetSheets(workbook); } catch (Exception ex) { ExcelParseEventArgs arg = new ExcelParseEventArgs(); arg.IsSuccessful = false; arg.Message = string.Format("{0} Please check file format.", ex.Message); if (ExcelParsing != null) { ExcelParsing(this, arg); } return(false); } return(true); } else { AlertMessages("Please input excel file."); return(false); } }