Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompted for network login when posting via AJAX 1

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
I'm running an ASP.NET application on a local intranet. One form has a button than uses AJAX to post a form in the background. I'm finding that when clicking this button for the first time I receive a network login prompt to access the web server. Once a valid network account is provided I'm not prompted again but obviously I don't want it to appear at all. Any ideas? The AJAX itself is:
Code:
var post_data = 'id=' + ie_id + '&locked=' + (locked ? '1' : '0') + '&budget=' + budget + '&phase_id=' + phase_id + '&notes=' + notes;

var http_request = InstanceOfHttpRequest();
if (http_request.overrideMimeType) http_request.overrideMimeType('text/html');

if (!http_request) return false;

http_request.onreadystatechange = function() { 
	if (http_request.readyState == 4) {
		var response_text = (http_request.status == 200 ? http_request.responseText : '');
		if (response_text == 'failed') {
			alert('Error');
		} else {
			alert('Success');
		}
	}
}
		
http_request.open('POST', 'post.aspx', true);
http_request.setRequestHeader("Content-type", "application/x-[URL unfurl="true"]www-form-urlencoded");[/URL]
http_request.setRequestHeader("Content-length", post_data.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(post_data);
 
I doubt very much if this is an AJAX issue. It sounds more like a server configuration issue.

Try visiting the URL directly in a new session - you'll probably be asked for the password.

If so, i think you need to configure the server to not authenticate for that URL.

Hope this helps,
Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks, you're probably right. I realise it's not your area of expertise, but are you able to explain how to configure a server to not authenticate certain URLs? It's just an IIS web server...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top