Can I deploy a javascript file within MVC areas?

前端 未结 4 569
你的背包
你的背包 2021-01-13 09:13

I have my js files inside areas and I cannot access them. When I move them outside the MVC areas then I can access.

I have tried the following:

  • Differ
4条回答
  •  鱼传尺愫
    2021-01-13 09:48

    Found an answer in another Stack Overflow question and tweaked it for areas.

    Modify /Areas/AreaName/Views/web.config file to enable the webserver to serve JS and CSS files:

    
        
            
            
            
        
        
    
    
    
        
            
            
            
            
        
        
    
    

    This will allow serving of .js and .css files, and will forbid serving of anything else.

提交回复
热议问题