I create a task as below:
ExportTask = Task.Factory.StartNew(() => ExcelExport(rs, ReportCenter));
Inside the ExcelExport() method I like to run a statement that will save an excel spreadsheet, but it needs to be on the main thread:
workbook.SaveAs(String.IsNullOrWhiteSpace(AppSettingsUtils.GetString("ExportExcelFileName")) ? "Export.xlsx" : AppSettingsUtils.GetString("ExportExcelFileName"), Response, ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2013);
For that matter I'm curious on how to get a value from a statement such as this in a task as well:
ReportCenter = HttpContext.Current.Profile.GetPropertyValue("ReportCenter");
Seems to be a lot of info on windows forms but having trouble finding for web forms. How can I accomplish this?