Use Ajax and JsonResult in ASP.NET MVC 3

前端 未结 3 1952
野趣味
野趣味 2020-12-29 16:33

I need to get string array or list with ajax and Action, this is my Implementation:

This is my html Dom of view of Index action in AccessMenuController:



        
3条回答
  •  时光说笑
    2020-12-29 17:13

    If your script resides in a .JS file then this is not going to work as it'll be treated as plain text. You can either move entire script to the view or you can re-factor script so that majority of the script remains in the .JS and you then pass relevant values from the view.

提交回复
热议问题