Does System.Web.Mvc.ListItem no longer exist in ASP.NET MVC RC? -


Trying to create a list to return a few JSON data to create a list. Some tutorials on the Web that were created during beta but in RC it seems that the code works.

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.Mvc; Namespace MvcApplication6.Controllers {[HandleError] Public Class HomeController: Controller {Public JsonResult List () {List & lt; ListItem & gt; List = new list & lt; ListItem & gt; {New list () {name = "value", some = "more value"}}; Return Jason (list); }}}  

The problem is that ListItem is not found in the System.Web.Mvc namespace. I can not seem to do this work if ListItem has been removed, how can you complete this release candidate in MVC?

List System System Web.UI.WebControls is in ... You probably do not want to use it, you can use SelectListItem which is in the System.Web.mvc namespace, but you have to change the property names (You also need to listItem Must do).

  Public Jason Result List () {List & lt; SelectListItem & gt; List = new list & lt; SelectListItem & gt; {New list () (text = "value", value = "more value"}}; Return Jason (list); }  

To do this, please list & lt; Object & gt; And anonymous forms so that I can define the name of the property according to my preference.

public JsonResult list () {list & lt; Object & gt; List = new list & lt; Object & gt; {New {name = "value", some = "more value"}}; Return Jason (list); }

Comments