I have an MVC website with C# code behind. I am using an ActionResult, that returns Json.
I am trying to put something in the ViewBag but it doesn't appear to work.
The code looks like this -
public ActionResult GetStuff(string id)
{
ViewBag.Id = id;
stuff = new StuffFromDatabase(id);
return this.Json(stuff , JsonRequestBehavior.AllowGet);
}
The "id" does not appear go in the ViewBag.Id.
Can I put the id in the ViewBag this way? If not any suggestions on how I should do it? Thanks!