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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AJAX POSTBACK

Status
Not open for further replies.

blah2468

Technical User
Mar 14, 2007
11
CA
hi there,
I'm getting a "Forbidden" error on my xml respons and I'm not sure what it means...

Hers's my code:
Please note, I have a AutoEmailManager.js file that contains the following code. I have a webUserControl that uses this .js file and it is called: "ucAutoEmailManager.ascx". If you look carefully, when I'm doing the AJAX call, I'm basically calling this user control again... is that allowed (am I allowed to do an AJAX call from x.ascx to x.ascx?)

Code:
//performs the ajax call:
function Display()
{
    url = "ucAutoEmailManager.ascx" +  
                                "?" +   "op"               +   "="     +   "DISPLAY" + 
                                "&" +   "rnd"              +   "="     +   Math.random();
    AJAXCall(url, StateHandler_Display);
}

//handles Ajax Response:
function StateHandler_Display()
{
    if (req.readyState == 4)
    {
        if (req.status == 200)
        {
            document.getElementById("divMain").innerHtml = req.responseText;
        }
        else
        {
            alert("There was a problem retrieving the HTML data:\n" +
                req.statusText);
        }
    }
 
Make sure the page you are requesting is on the same domain (most likely in this case, I think).

Hmmm... don't you need to define "req" in the function StateHandler_Display?
Code:
 function StateHandler_Display([!]req[/!]) {
Just a thought.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
hey thanx for the help,

I found the problem:
I am using a "Web user control" to handle my AJAX call and I guess .net doesn't like that. So instead, now I'm using a web Page control and everything is ok.

Jeff, "req" is actually defined as part of the main JS class I use in my masters class... but I can totally see why you're suggesting it ;)

Billy, I was looking for that section... thanx for the link!


cheers!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top