-
Feb 3rd, 2012, 01:21 PM
#1
Thread Starter
Member
[RESOLVED] AJAX request call not working
Hello,
I'm trying to track down a bug.
On the client side, I've got some javascript code that makes an AJAX request to the server. The request seems to be returning to the callback function with readystate 4 but no XML data. I'm working in Visual Studios 2008 and I have confirmed with the debugger that the codebehind C# code that's supposed to be run when the server receives the AJAX request isn't running at all (which explains the lack of XML data in the response). I'm having trouble figuring out why this is.
The AJAX call looks like this:
Code:
http_request.open(method, filename, async);
http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
http_request.send(data);
method = 'POST'
filename = 'ChargeCodeSave.aspx'
async = true
data is a big long string that's too big to post.
Once this request gets sent, it goes off into cyber-space and the debugger can't trace it. All I know is that the codebehind specified in ChargeCodeSave.aspx, which is ChargeCodeSave.aspx.cs as the following (and only) line from ChargeCodeSave.aspx shows:
<%@ Page language="c#" Codebehind="ChargeCodeSave.aspx.cs" AutoEventWireup="True" Inherits="CoreData.Net2.ChargeCodeSave" %>
isn't run.
I don't think you'd need to know what the Page_Load method in the C# codebehind file looks like (since it's not even executing), but here it is anyway:
Code:
protected void Page_Load(object sender, System.EventArgs e)
{
// Clean the cache of CommonSession for each page load.
TimeSheetUtility.ResetSessionCache();
MessageBox.Show("message box");
XmlDocument xmlReply = null;
ParseInput ();
// Parse the input variables
switch (Request.Form["action"])
{
case "validate" :
xmlReply = Validate ();
break;
case "process" :
xmlReply = Process ();
break;
default :
break;
}
// Set the encoding of the document
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "application/xml";
// Output the response of the loading
Response.Write (xmlReply.OuterXml);
}
Can anybody suggest what the problem might be?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|