Top "Viewdata" questions

ViewData is a dictionary used in C# MVC to pass data from the controller to the view.

The name 'ViewData' does not exist in the current context

I am working over my first application over MVC3 and still kind of a newbie in it: I’m trying …

.net asp.net-mvc-3 master-pages viewdata viewbag
Can't access ViewData in a partial view in ASP.NET MVC3

I have a controller calling a view. In the view there is a partial view, inserted like this: @{ Html.RenderPartial("…

asp.net-mvc-3 partial-views viewdata
There is no ViewData item with the key 'Blah' of type 'IEnumerable<SelectListItem>'

This error message is driving me nuts. I'm getting it when using Html.ListBox and Html.DropDownList HtmlHelpers with ASP.…

asp.net-mvc model-view-controller html-helper viewdata
Return multiple views to one ActionResult with ASP.NET MVC

What I want to achieve essentially is: Items assigned to me Item 1 assigned to me Item 2 assigned to me Item 3 …

asp.net-mvc viewdata
ASP MVC Access ViewData Array?

I have some viewdata that is generated by going through my repository to the database to grab some scheduling info. …

asp.net-mvc viewdata
View data from view to controller

Is there an easy way to pass an object from my view to controller? I tried ViewData["newPerson"] but that …

c# asp.net asp.net-mvc viewdata
How do you persist querystring values in asp.net mvc?

What is a good way to persist querystring values in asp.net mvc? If I have a url: /questions?page=2&…

asp.net-mvc query-string viewdata
Populating dropdownlist with selectlist in ViewData

I'm trying to populate an HTML. Dropdownlist with a selectlist which is populated with a string value (a location address) …

javascript model-view-controller drop-down-menu viewdata selectlist
Storing data in HttpContext.Current.Items vs ViewData

When is it appropriate to store data in HttpContext.Current.Items[...] vs storing data in ViewData[...]? I'm trying to figure …

asp.net-mvc httpcontext viewdata
MVC 3 Razor - Access ViewData in Ajax Request (Jquery, JavaScript)

I am writing some code where the user can check if a username already exists in the database before submitting …

jquery ajax asp.net-mvc-3 razor viewdata