Link to home
Start Free TrialLog in
Avatar of Stacie
StacieFlag for United States of America

asked on

Static method and TempData, what is another alternative?

I'm trying to find  a way to pass  a TempData from a static method to another method but I'm having some issue finding the correct answer to this problem bellow, since I can't use a TempData in a static field..

   
 public static XtraReport BuildReportObject(DailyEmployeeRecapSearchCriteria searchCriteria)
        {
           var resultsContainer = GetReportResults(searchCriteria)
           TempData['"value"] = resultsContainer;  I can't do this, since its a static field.
          ........

          return SetDefaultsForReportObject(mainReport, .....
        }

why I wanted to use a TempData so that I could use it into another method.

 public FileResult ExportCsvFormat(string dataSource)
        {
  foreach (var x in (List<GroupBillingCustomerDetails>)TempData["GroupBillingdata"])  > Then here I can use my TempData ...
                {

}.....
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial