Top "Viewbag" questions

ViewBag is a dynamic type object in the ASP.

Can't access ViewBag in a partial view in ASP.NET MVC3

I have a controller calling a view. In the view there is a PartialView called be @Html.Partial("ViewName", model). …

asp.net-mvc-3 viewbag
Setting up the value in ViewBag using Jquery

I just want to ask, is there a way to set up the viewbag value dynamically using jquery? I try …

jquery asp.net-mvc viewbag
Viewbag check to see if item exists and write out html and value error

I'm using razor syntax and I want to check to see if certain ViewBag values are set before I spit …

c# asp.net-mvc viewbag
How can I show a viewbag as html?

OK, quite new to ASP.Net MVC, so I'm sorry if this is a silly question, but how do I …

c# asp.net asp.net-mvc-3 viewbag
mvc c# html.dropdownlist and viewbag

So I have the following (pseudo code): string selectedvalud = "C"; List<SelectListItem> list= new List<SelectListItem>(); …

asp.net-mvc html.dropdownlistfor viewbag html-select
Modifying MVC 3 ViewBag in a partial view does not persist to the _Layout.cshtml

I am using MVC 3 with the Razor view engine. I want to set some values in the ViewBag inside a …

view asp.net-mvc-3 razor partial viewbag
using viewbag with jquery - asp.net mvc 3

I have a ViewBag.IsLocal set to true in controller. I would like to use jquery to check the ViewBag …

jquery asp.net-mvc-3 viewbag
Checking to see if ViewBag has a property or not, to conditionally inject JavaScript

Consider this simple controller: Porduct product = new Product(){ // Creating a product object; }; try { productManager.SaveProduct(product); return RedirectToAction("List"); } catch (…

asp.net-mvc-3 dynamic razor null viewbag
Assign Attribute to @Html.DropdownList

I want to assign some ID attribute name to my Dropdown list which is using data from the ViewBag as, …

asp.net-mvc razor html-select viewbag
How does ViewBag in ASP.NET MVC work behind the scenes?

I am reading a book on ASP.NET MVC and I'm wondering how the following example works: Example #1 Controller public …

c# asp.net-mvc dynamic viewbag