Virender Thakur
Virender Thakur

Reputation: 519

Getting the 401 Status code when using the external js file

I have created a simple web site in asp.net and I have used the two js file on my page Code of customerpage.aspx page

<head runat="server">
<title>Sample Site</title>
   <!-- jQuery -->
<script type="text/javascript" src="http://localhost:63645/Customer/GetResources?resourceName=CUST.Data.Scripts.3rdParty.jquery.min.js"></script>
<script src="http://localhost:63645/index.js"></script>
 <link rel="stylesheet" href="http://localhost:63645/index.css">
</head>

I have used the ajax call. When I ran the project it gives me error the server responded with a status of 401 (Unauthorized). To use External java-script it might need username and password, so I have download these files to my local folder where project exists and tried to run the project and still getting same error.

Code after downloaded the files to local.

<script src="js/CUST.Data.Scripts.3rdParty.jquery.min.js"></script>
<script src="js/index.js"></script>
<link href="css/index.css" rel="stylesheet" />

I don't know what is wrong. Any help will be much appreciated.

Upvotes: 1

Views: 634

Answers (1)

Virender Thakur
Virender Thakur

Reputation: 519

After spending time I have found the solution by changing

Change:

settings.AutoRedirectMode = RedirectMode.Permanent;

To:

settings.AutoRedirectMode = RedirectMode.Off;

Upvotes: 1

Related Questions