I've writen a very simple Actionresult which derives from ViewResult
public class FormResult : ViewResult
{
public override void ExecuteResult(ControllerContext context)
{
context.Controller.ViewBag.Form = "value";
base.ExecuteResult(context);
}
}
It basically just adds a value to ViewBag.
Then I'm returning it in the action method.
public ActionResult Index()
{
return new FormResult();
}
The problem is, the ViewBag is empty in the appropriate view.
Am I missing something here ?