Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 14th, 2006, 08:50 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default URGENT - retrieve javascript variable into asp

Hi,

I've been struggling with this for days. I am calling a function from a very complex asp page/form that uses the XMLHTTP object to handle some processing on another server. I need to grab the result of the call which is in javascript. I know that everything I read says to load the javascript into a hidden field on a form and submit it. This is not an option for me, because the calling page is so complicated. It would take forever to reload the entire form and fill in all previously entered data, just to get to the point where I left off. I then tried using a session variable, but since my results are being set from another server using the XMLHTTP object, the session data is not retained.

Please help! I'm approaching my deadline and not getting anywhere!
Thanks.
MelissaM
Reply With Quote
  #2 (permalink)  
Old June 14th, 2006, 10:15 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Melissa,

Can you create a page on your server then use XmlHttp to send the data to that page & process it there?

Cheers,

Chris

Reply With Quote
  #3 (permalink)  
Old June 14th, 2006, 12:58 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought of that, but I'm getting so confused since I already have a call to xmlhttp for a different reason.
I'm pretty new to this object.

I have a js function that uses xmlhttp to call a server side script which access another domain via asp. I return the results back to the js function. This is where I'm stuck since the results are in js.

So I need to create an ASP function that calls my js function from the server using xmlhttp? (I'm so confused!)
Can you elaborate on what part you think needs to be in asp and what in js? Ultimately I need my return status value back in an ASP variable.

Thanks.
Melissa
Reply With Quote
  #4 (permalink)  
Old June 15th, 2006, 03:23 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Melissa,

Sounds like you may be able to create an ASP page that you call via XmlHttp from your JavaScript with the results from the first call.

On this ASP page, you can do whatever processing you need to do using the information in the XmlHttp call.

So...

1. Client-side: send XmlHttp request to other server
2. Client-side: parse XmlHttp response from other server and create XmlHttp request to your server with results
3. Server-side: parse XmlHttp request and action as required

You cannot call a clientside function from the server using XmlHttp.

HTH,

Chris

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing ASP variable from Javascript sasidhar79 Classic ASP Basics 2 March 8th, 2017 05:31 PM
storing Javascript variable to ASP variable rupen Classic ASP Basics 5 April 10th, 2007 07:06 AM
assign javascript variable to asp variable manjunath_c_k Classic ASP Basics 1 September 14th, 2006 07:35 AM
Javascript variable values into ASP phungleon Classic ASP Basics 2 May 13th, 2004 02:10 PM



All times are GMT -4. The time now is 01:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.