How to pass parameter from one Controller to another in Asp.Net

4
Hello, I have an object that needs to pass by parameter to another Controller through RedirectToAction , I used TempData however after any page change it loses the reference, know of some solution so that it does not lose the reference ? Or does it need to be done differently?

    
asked by anonymous 16.05.2014 / 22:23

1 answer

6

It's otherwise:

return RedirectToAction("OutraAction", "Controller", new { minhaClasse = /* objeto do tipo MinhaClasse */, area = "area"})

Then your Controller looks like this:

public ActionResult OutraAction(MinhaClasse minhaClasse) { ... }
    
16.05.2014 / 22:26