ASP.NET MVC - Pass Json String to View using ViewData
问题 I'm trying to pass Json to my View using ViewData Controller ViewData("JsonRegionList") = Json(RegionService.GetActiveRegions()) view $("input#UserRegion").autocomplete({ source:"<%: ViewData("JsonRegionList").ToString %>", minLength: 3, but the problem I'm running into is the output source looks like $("input#UserRegion").autocomplete({ source:"System.Web.Mvc.JsonResult", minLength: 3, which is obviously not right. Am I missing something basic? 回答1: The Json() controller method returns a