Form submit resulting in “InvalidDataException: Form value count limit 1024 exceeded.”

前端 未结 4 1500
广开言路
广开言路 2020-12-05 17:01

I have created an mvc site and I\'m posting a large amount of json form data (Content-Type:application/x-www-form-urlencoded) back to the mvc controller. When I

4条回答
  •  悲哀的现实
    2020-12-05 17:59

    If you are using .net core 2.1 or above, you can use the built in RequestFormLimits attribute as shown below on a controller or action-

    [RequestFormLimits(ValueCountLimit = 5000)]
    public class TestController: Controller
    

    Link to official docs

提交回复
热议问题