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

Posting information to a asp page without going to it

Status
Not open for further replies.

funkydonkey2000

Programmer
May 29, 2003
12
0
0
AU
Usually when you post information from a form to another asp page like this:

<form method="post" action="someASPPage.asp">

It will redirect you to 'someASPPage.asp'.

I was wondering if there is a way of posting information from a form to another asp page, but not actually going to that asp page.
 
But where do you want to go...do you want to be on the same page...

it can be easily done using Javascript...

provide more details on what actually you want to do

-VJ

 
Well is like this. I have a form for a user to enter their email. When submited, I want to go to success.asp page.

In the form there is also a checkbox to subscribe to a mailing list. If the checkbox is checked, I have to pass the email to addtomailinglist.asp page sitting on another server, which adds the address to the mailing list. Because it is sitting on another server, I can't use server.execute.

I don't want to show addtomailinglist.asp. I just want to show success.asp page when the form is submited even with the subsribe checkbox is checked. And I can't edit the addtomailinglist.asp to redirect it back to success.asp.

Hopefully this make sense.

Thanks

Tony
 
Hi Tony

You can use XMLHTTP to post the information to addtomailinglist.asp remotely.

There are lots of great examples of using XMLHTTP object on the net.

Regards
Satish
 
But XML may not be an option for Tony if his server doesn't have the XML component installed.

Is the mailing list part on your server? is it a database? Need more details...

www.sitesd.com
ASP WEB DEVELOPMENT
 
XML is not necessary to use XMLHTTP. XML is more of an add-on set of properties for that object, basically it's just WinHTTP with a couple extra methods. Since the core of XMLHTTP is to send a GET/POST request to another server and receive a response, I think it should work just fine in this situation. If your worried about the time it takes and don't care if it errors out you could even run it asynchronously, starting it first thing, going about and finishing the rest of the processing/entries to db/etc, then letting it catch up before redirecting. Actually, you could still catch errors (500 errors, 400, etc) you would just do it at the end of the page after you have processed the data for your local functionality.

-T

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
Help, the rampaging, spear-waving, rabid network gnomes are after me!
 
I agree. Using the Microsoft.XMLHTTP option is the best for what is described above.

I thought the MS XMLHTTP object was part of the WIN2k or XP Professional server packages?
(I assumed that one of the two servers is being used.)

 
It is included in the MSXML packages and I beleive those are updated with standard patches and such. I'm fairly certain Windows XP comes with it (probably MSXML4), can't remember if 200 came with one (MSXML2 maybe?), and fairly certain Windows NT didn't have them. I don't remember ever installing by hand on this machine and it is running 2000 server, so I am assuming it either came with them or they were added by windows update.

-T

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
Help, the rampaging, spear-waving, rabid network gnomes are after me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top