Top "Viewbag" questions

ViewBag is a dynamic type object in the ASP.

MVC3 putting a newline in ViewBag text

I have an MVC3 C#.Net web app. I am looping through a DataTable. Some rows are importing OK, some …

c# asp.net-mvc-3 text line-breaks viewbag
Null TempData when passing data from controller to view MVC

I have the following class in a Controller passing data to a View: public ActionResult ControllerToView(){ ... TempData["example"] = "this is …

c# asp.net-mvc viewbag tempdata
How can I use data placed into a ViewBag by a filter in my Error.cshtml view?

I have an action filter that is responsible for placing some common information into the ViewBag for use by all …

asp.net-mvc asp.net-mvc-3 action-filter viewbag
Clear the ViewBag?

Is there any way to clear the ViewBag? ViewBag has no setter, so it can't simply be nulled out: ViewBag = …

c# asp.net-mvc viewbag
Passing a model object through ViewBag

I was wondering if it is possible to pass a model object through ViewBag. I tried the following codes but …

asp.net-mvc-3 viewbag
ViewBag multiple SelectList for dropdown list

I am trying to use dropdownList with two foreign keys which are modelId, and categoryId. And I am using ViewBag …

asp.net-mvc-3 selectlist viewbag
Storing an Anonymous Object in ViewBag

This is probably a silly question, but I am trying to stuff an anonymous object in ViewBag like so: ViewBag.…

c# asp.net-mvc-3 reflection anonymous-types viewbag
RenderPartial and ViewBag

I'm trying to modify this code: http://www.codeproject.com/Articles/260470/PDF-reporting-using-ASP-NET-MVC3 To make it to get the ViewBag data …

asp.net-mvc html-helper viewbag
ViewBag - Object reference not found - MVC 3

Upon publishing my MVC 3 Web Application to my website I get an error stating an Object reference not set to …

asp.net-mvc null viewbag
Is using ViewBag in MVC bad?

It seem like mvc 3 team decided to bring in a feature for dynamic data exchange between a controller and a …

asp.net-mvc asp.net-mvc-3 viewbag