📜  viewdata 数组 mvc razor javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:43.701000             🧑  作者: Mango

代码示例1
// For ASP.NET  
var monthLists = @Html.Raw(Json.Encode(ViewData["months"]));

// For ASP.NET CORE
var monthLists = @Html.Raw(Json.Serialize(ViewData["months"]));