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

后端 未结 3 1396
迷失自我
迷失自我 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 06:45

    What form of authentication are you using, if any? The first thing that comes to mind is to make sure that your webApp in IIS is set to allow anonymous users (if you indeed desire to make the call as an anonymous user). Also that your Authentication mode in web.config is not set to Windows by mistake. If you cannot allow anonymous users and are using forms authentication, then the user will have to be logged in before this call is made from your page.

    If the above are properly set, then try making a regular call to the service from server side to make sure the problem is consistent regardless of the point of invocation of the service.

    Post more settings if the problem is not resolved. Hope this helps.

提交回复
热议问题