ASP.Net 3.5 WebMethod called using jQuery AJAX throws Unauthroized 401 error

228 views Asked by At

I am trying to call a web method using jQuery and having same issue as this question, but I am working with ASP.Net 3.5 web forms, and don't have ~/App_start/routeconfig.cs.

How can I fix this error with ASP.Net 3.5?

2

There are 2 answers

0
Ali Soltani On BEST ANSWER

For doing that, you can adding below code in web.config:

<authorization>
   <allow users="*" />
</authorization>

For more information, please see allow Element for authorization.

0
AlbertK On

If the problem is really in authorization, then try to allow an anonymous access to your login page in web.config:

<location path="Login.aspx">
  <system.web>
    <authorization>
      <allow users="*"/>
    </authorization>
  </system.web>
</location>