Intermittent asp.net mvc exception: “A public action method ABC could not be found on controller XYZ.”

后端 未结 13 740
春和景丽
春和景丽 2020-12-02 04:57

I\'m getting an intermittent exception saying that asp.net mvc can’t find the action method. Here’s the exception:

A public action method \'Fill\' cou

13条回答
  •  孤街浪徒
    2020-12-02 05:38

    The currently accepted answer does work as expected but isn't the primary use case for the feature. Instead use the feature defined by ASP.NET. In my case, I denied everything but GET and POST:

      
      
          
              
                  
                  
              
          
      
     
    

    With the code snippet above, MVC will correctly return a 404

提交回复
热议问题