By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,275 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,275 IT Pros & Developers. It's quick & easy.

call post w/ classic asp

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
"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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.