I'm wondering if there is a good way to do this. I'm currently trying to send some temporary data to multiple partial views being called from the same view page in my MVC application.
I'm currently attempting to do this with TempData but I can see my understanding is limited as it is only going through for one partial request. What method do I need to use to filter out to all of my partials?
Main View Page:
@{
ViewBag.Title = "Main View Page";
TempData["ReturnUrl"] = Request.Url.OriginalString.ToString();
}
@Html.Partial("_StatusTable1")
@Html.Partial("_StatusTable2")
@Html.Partial("_StatusTable3")
@Html.Partial("_StatusTable4")
@Html.Partial("_StatusTable5")
Partial View Example:
@{
var temp = TempData["ReturnUrl"]; // temp is null on all partials except the first
}
// Partial View Code ...
Thanks in advance.
In your main view page call the partiel views like that
I think that even this would work.