0

私はasp.net mvc actionmethodを戻り値の型としてJsonResultとして呼び出し、少なくとも50000のracordsを持つデータのリストを返し、Ajaxの戻り値のサイズも設定したいと思います。それも同様に行われます。 JsonRequestBehavior.AllowGetをreturn JsonResultに設定するには

しかし、私は値を返すとき、それは私にエラーをスロー:

This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet. 

マイコード:ここで私はJsonRequestBehavior.AllowGetを設定したいが、どこで、どのように知りません

return new JsonResult() 
      { 
       Data = mydatalist, 
       MaxJsonLength = Int32.MaxValue 
      }; 

事前に感謝の意を表します。

答えて

3

JsonResultの中で利用できるオプションが表示されたら、JsonRequestBehaviorが見つかり、それを許可として設定します。

return new JsonResult() 
     { 
      Data = mydatalist, 
      MaxJsonLength = Int32.MaxValue, 
      JsonRequestBehavior = JsonRequestBehavior.AllowGet 
     }; 
関連する問題