1

I am trying to send some information from a drop down menu when it changes to a classic Asp action page which I want to have grab the information, format it as needed and then return the final variable value. Everything submits fine to Asp but I get a blank value returned.

Here is my JQuery

$.ajax({ 
    type: "POST", 
    url: "newslettercreate_action.asp", 
    data: { newsletter_publication: id_val, func_id: "1" },
    dataType: "html",
    success: function(theSite) {
    alert(theSite);
},
    error: function(){
    alert("fail");
}
           });

And here is the Asp that is handling this information

    thisQuery = ""
    set thisRS = dbAccessObj.DirectQuery("live", thisQuery)
    newsletter_list = thisRS("newsletter_list")
    newsletter_list_vals = Split(newsletter_list,"_")
    UBound(newsletter_list_vals)
    theSite = newsletter_list_vals(0)

I modded the asp code a bit to just show the important parts. My ultimate goal is to return theSite to JQuery Ajax to later be used but as I said, it is returning a blank value.

2
  • Have you tried calling that ASP page directly in a browser to make absolutely sure it is returning a value? If you hardcode the newslettercreate_action.asp to response.write a value does that work? Commented Jun 2, 2012 at 15:14
  • Also when you say "I get a blank value returned", returned by what exactly? Commented Jun 2, 2012 at 15:16

2 Answers 2

1

Are you writing out the value? I don't see a Response.Write in your posted code:

Response.Write(theSite)
Sign up to request clarification or add additional context in comments.

1 Comment

I didn't have a response.write. I thought I would have just needed to define the variable. This worked out. Thanks so much!!
0

First make sure you are printing a response on the ASP page

response.write(some viariable)

I had the same issue. On your Ajax code make sure you are set to GET not POST

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.