Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Participant
1553 Points
371 Posts
May 14, 2012 11:59 AM|LINK
You can not use ViewBag to pass values between controllers.
use TempData if you want to keep the value from one action to another action in a same controller.
I.e;
Assigning
TempData["SomeID"]="Values";
and to retrieve
var MyValues=TempData["SomeID"];
abdu292
Participant
1553 Points
371 Posts
Re: How do I pass an array via ViewBag from view to action?
May 14, 2012 11:59 AM|LINK
You can not use ViewBag to pass values between controllers.
use TempData if you want to keep the value from one action to another action in a same controller.
I.e;
Assigning
TempData["SomeID"]="Values";
and to retrieve
var MyValues=TempData["SomeID"];
With best regards,