Getting “401 Unauthorized” error consistently with jquery call to webmethod

后端 未结 3 1419
迷失自我
迷失自我 2021-01-12 06:17

I have been struggling to get my jquery call to a webmethod to work. I am being bounced by the server with a \"401 Unauthorized\" response. I must have an incorrect settin

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-12 07:00

    The json response from the Firebug Console provides the most telling clue IMO. The System.InvalidOperationException (which strangely rides on a 401 response) suggests something more is at work.

    First, googling on "InvalidOperationException webmethod jquery" returns articles which suggest serialization problems can throw this exception. To rule this out, temporarily change "data: paramList" to "data: '{}'". In addition, attach a debugger and see if the exception happens before the method executes or after it completes and attempts to serialize the result.

    If the steps above come up empty, you may want to try resetting to a clean web.config or read more of the results that come back from the "InvalidOperationException webmethod" search

提交回复
热议问题