473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

call post w/ classic asp

I've got a form that posts to itself when submitted.

Right now, after the form is submitted, the code checks that all of its
fields are valid, then processes the information. If all goes well, visitors
are then redirected using Response.Redirect("thanks.asp").

What I'd like to do is replace Response.Redirect("thanks.asp") with
something more like the post that happens on the form so that "thanks.asp"
can display a summary of what was submitted.

Is there a way to do this? Can you call a "post" somehow from Classic ASP?

I have not spent a lot of time with ASP, so it could be something simple!
Sep 19 '07 #1
7 17411
"jp2code" <poojo.com/mailwrote:
>I've got a form that posts to itself when submitted.

Right now, after the form is submitted, the code checks that all of its
fields are valid, then processes the information. If all goes well, visitors
are then redirected using Response.Redirect("thanks.asp").

What I'd like to do is replace Response.Redirect("thanks.asp") with
something more like the post that happens on the form so that "thanks.asp"
can display a summary of what was submitted.

Is there a way to do this? Can you call a "post" somehow from Classic ASP?
No. IMHO the best way to handle this is to store the data from the
form into the session object (Session("myvar")=whatever). Then the
page you forward to can retrieve the data from there and do whatever
it wants with it.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
http://members.cox.net/slatteryt
Sep 19 '07 #2

"jp2code" <poojo.com/mailwrote in message
news:%2*****************@TK2MSFTNGP04.phx.gbl...
I've got a form that posts to itself when submitted.

Right now, after the form is submitted, the code checks that all of its
fields are valid, then processes the information. If all goes well,
visitors are then redirected using Response.Redirect("thanks.asp").

What I'd like to do is replace Response.Redirect("thanks.asp") with
something more like the post that happens on the form so that "thanks.asp"
can display a summary of what was submitted.

Is there a way to do this? Can you call a "post" somehow from Classic ASP?
Instead of Response.Redirect, use Response.Write to summarise what was
submitted. Yes, it really is that simple.

<%
Sub showform
%>
<form method="post">
Your Name: <input type="text" name="FirstName" /><br />
<input type="submit" name="Submit" value="Submit" />
</form>
<%
End Sub

If Request.Form("Submit") = "" Then
call showform()
Else
If Len(Trim(Request.Form("FirstName")))>0 Then
Response.Write "Your name is " & Trim(Request.Form("FirstName"))
Response.Write "<br />Thanks!!"
Else
Response.Write "You forgot to enter your name"
call showform()
End If
End If
%>

--
Mike Brind
Sep 19 '07 #3
Mr. Slattery:

Thanks! That was even easy to implement! I've already got it working.

A+

"Tim Slattery" wrote:
>
No. IMHO the best way to handle this is to store the data from the
form into the session object (Session("myvar")=whatever). Then the
page you forward to can retrieve the data from there and do whatever
it wants with it.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
http://members.cox.net/slatteryt

Sep 19 '07 #4
instead of redirecting, you can use "server.execute". When you need to process that code, use :

server.execute("thanks.asp")

the "thanks.asp" file will have use of all information in the request object.
"jp2code" <poojo.com/mailwrote in message news:%2*****************@TK2MSFTNGP04.phx.gbl...
I've got a form that posts to itself when submitted.

Right now, after the form is submitted, the code checks that all of its fields are valid, then processes the information. If all
goes well, visitors are then redirected using Response.Redirect("thanks.asp").

What I'd like to do is replace Response.Redirect("thanks.asp") with something more like the post that happens on the form so that
"thanks.asp" can display a summary of what was submitted.

Is there a way to do this? Can you call a "post" somehow from Classic ASP?

I have not spent a lot of time with ASP, so it could be something simple!

Sep 19 '07 #5
So, lots of different tricks for doing the same thing! I like it!

"Jon Paal [MSMD]" pointed out:
instead of redirecting, you can use "server.execute". When you need to
process that code, use :

server.execute("thanks.asp")

the "thanks.asp" file will have use of all information in the request
object.

Sep 19 '07 #6
"jp2code" wrote:
So, lots of different tricks for doing the same thing! I like it!
Can you stand another? There is also Server.Transfer:
http://msdn2.microsoft.com/en-us/library/ms525800.aspx

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Sep 19 '07 #7
Gazing into my crystal ball I observed "jp2code" <poojo.com/mail>
writing in news:#e*************@TK2MSFTNGP04.phx.gbl:
I've got a form that posts to itself when submitted.

Right now, after the form is submitted, the code checks that all of
its fields are valid, then processes the information. If all goes
well, visitors are then redirected using
Response.Redirect("thanks.asp").

What I'd like to do is replace Response.Redirect("thanks.asp") with
something more like the post that happens on the form so that
"thanks.asp" can display a summary of what was submitted.

Is there a way to do this? Can you call a "post" somehow from Classic
ASP?

I have not spent a lot of time with ASP, so it could be something
simple!

The way I deal with this is this:
1. Start the page off with issubmitted = false
2. Validate and do whatever posting to db I need to do.
3. Change issubmitted to true

HTML is something like:
<% if not issubmitted then%>
<form method="post" action="<%=request.servervariables("Script_name")% >">
<div>
<label for="name" id="name1">Name:</label<input type="text" name="name"
value="<%=name%>" id="name"><br>
<input type="submit" value="Submit">
</form>
<%else%>
<p>Thank you for submitting the information below:</p>
<dl>
<%For ix = 1 to Request.Form.Count
field = request.form.key(ix)
inputvalue = request.form.item(ix)%>
<dt><%=field%></dt>
<dd><%=inputvalue%></dd>
<%next%>
</dl>
<%end if%>

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Sep 21 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: paulette | last post by:
I have read a zillion and one posts on this exact same problem, but none of them has suggested anything that works for me. So... I am using .Net Framework Version 1.1.4322 I have: 1. Created...
6
by: Keith E. | last post by:
Does any one know of resources or can you offer direction on how to use classic ASP as a web service client. I have found all kinds of stuff for the ASP.NET But, I need to be able tap into a...
6
by: ASPfool | last post by:
Hello everyone, Please help me before I throw my computer out of the window: I'm working on a web application in classic ASP (vbscript), which is making calls to some webservices. The calls...
3
by: Mark | last post by:
Hi From what I understand, you can pass arrays from classic ASP to .NET using interop, but you have to change the type of the.NET parameter to object. This seems to be because classic ASP passes...
2
by: Rob Shorney | last post by:
Hi, We currently have a classic asp web application. We are currently looking at upgrading this to ASP.NET. However I have a couple of problems that need to be resolved. 1. aspx forms...
7
by: MeAgin | last post by:
Hi all, I want to call a classic ASP page from my vb.net code. How this can be done? Normally I would create an object from MSXML2.XMLHTTP and then call the Get method and the ResponseText wiuld...
1
by: prabodha | last post by:
I am developping a new module for an existing application written in classic ASP.The requirement is such , I have to call a classic ASP code segment from within the ASP.net .I am using C# as the main...
3
by: alandiit | last post by:
Hi every body I would like connect three combo box (CascadingDropDown with a Database) MYSQL by asp classic or Java Script . But I have a problem with this example , when I will change City ,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.