Stacie
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(DailyEmp loyeeRecap SearchCrit eria searchCriteria)
{
var resultsContainer = GetReportResults(searchCri teria)
TempData['"value"] = resultsContainer; I can't do this, since its a static field.
........
return SetDefaultsForReportObject (mainRepor t, .....
}
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<GroupBillingCustomer Details>)T empData["G roupBillin gdata"]) > Then here I can use my TempData ...
{
}.....
public static XtraReport BuildReportObject(DailyEmp
{
var resultsContainer = GetReportResults(searchCri
TempData['"value"] = resultsContainer; I can't do this, since its a static field.
........
return SetDefaultsForReportObject
}
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<GroupBillingCustomer
{
}.....
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.