How to get Data from Model to JavaScript MVC 4?

后端 未结 4 1947
借酒劲吻你
借酒劲吻你 2021-02-13 23:10

that\'s my function:

 

        
4条回答
  •  再見小時候
    2021-02-13 23:21

    var errors = '@Html.Raw(Json.Encode(ViewData.ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage)))';
    var errorMessage=JSON.parse(errors);
    

提交回复
热议问题