MVC - Accessing css, image, js files in view folder

后端 未结 4 1843
抹茶落季
抹茶落季 2020-12-11 15:00

In my mvc 3 application, assuming I have a folder structure like \\Views\\Account\\js\\custom.js How do I add that file to my view in the Account\\index.c

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 15:21

    The web.config file in the /Views folder restricts all access to files in the folder by default:

    
      
    
    

    You could change that, but it's probably more secure overall to not store the assets in the views folder.

提交回复
热议问题