Stack0verflow
Stack0verflow

Reputation: 1178

jQuery ajax call to web service (asmx) triggers an authentication popup

In my asp.net 4.0 eCommerce web application, a logged-in customer can click on anchors such as "Orders in the past 6 months" or "Orders in the past year" to view his past orders. When such anchors are clicked, I make a $.ajax call to my asmx web service method to retrieve a list of past orders and display them, like below:

$.ajax({
    type: "POST",
    url: "/webservices/OrderServices.asmx/GetOrderList",
    data: theParamter,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(data){
        displayOrders(data);
    },
    error: function(errMsg) {
        alert(errMsg);
    }
});

The web service method in c# is very simple, just a web method to get a list of orders for the specified past duration.

theParameter is obtained before the ajax call, which is just a parameter indicating if the customer wants to view the orders of the past 6 months or past year.

Everything works perfectly on my dev environment using IIS Express. But on production, when user clicks on either of the anchors, the browser pops up a small diablog box, asking the user to enter user name and password.

What's causing this? The web service (asmx) isn't aware that the request is sent from an authenticated customer? How to prevent the browser from displaying the authentication popup? Thank you!

Upvotes: 0

Views: 1535

Answers (1)

Dalorzo
Dalorzo

Reputation: 20014

It is possible that your server has Windows Security or Security was not properly configured for your site. Please visit the links bellow they are guided steps on how to disable windows security:

http://www.youtube.com/watch?v=CtpkXsWgcAM

http://technet.microsoft.com/en-us/library/cc731244(v=ws.10).aspx

Upvotes: 2

Related Questions