Solved

method=Post action=page2.asp (Refresh page)

Posted on 2002-04-09
7
789 Views
Last Modified: 2008-03-06
I have page1.asp that contains text boxes etc. and a "submit" button. I have <form method=Post action=page2.asp>, which works fine. However, I do not want the page2.asp to be loaded into the browser window, I want to call the page2.asp to do the processing, and then simply refresh page1.asp.  page1.asp contains a table from a database, and the user adds and deletes records, so I wish to just refresh page1.asp to show the updated db values. Thanks
0
Comment
Question by:Malek103197
  • 3
  • 3
7 Comments
 
LVL 3

Expert Comment

by:phuctran
ID: 6929944
page1.asp
<form method="Post" action="page2.asp">
  <input ...>
</form>

page2.asp
<%
  REM process data
  REM don't Response.Write anything to the browser
  .....

  REM after processing
  Response.Redirect("page1.asp")
%>
0
 
LVL 3

Expert Comment

by:phuctran
ID: 6929950
on page1.asp and page2.asp, you should have these lines

<%
  Option explicit
  Response.Buffer = TRUE
  Response.Expires = 0
  Response.ExpiresAbsolute = Now - 1
%>
0
 

Author Comment

by:Malek103197
ID: 6930049
phutran,

I tried both but got errors -

where do I place

<%
 Option explicit
 Response.Buffer = TRUE
 Response.Expires = 0
 Response.ExpiresAbsolute = Now - 1
%>

and where to i place

Response.Redirect("page1.asp")
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 3

Accepted Solution

by:
phuctran earned 100 total points
ID: 6930098
Place
<%
Option explicit
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1
%>
at the beginning of the page1.asp and page2.asp

Place
Response.Redirect("page1.asp")
at the end of page2.asp
0
 

Author Comment

by:Malek103197
ID: 6930152
OK, great, except I had to comment out the Option explict. if I don't then there is an error in the line -
connString = "DRIVER={Microsoft Access Driver (*.mdb)}; "

the error is that the variable connString is undefined. Do I really need the Option explicit?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6930166
Yes, you really need Option Explicti, and you get rid of that error messagfe by adding a line, BEFORE the line

connString = "DRIVER={Microsoft Access Driver (*.mdb)}; "


that reads

Dim connString  


That will DECLARE a variable, with the name connString

Option Explicit FORCES you the DECLARE every variable used in your program (that way if you MIS-SPELL a variable name, the program will NOT run).  Without Option Explicit, every variable is automatically created when it is encountered - so that a mis-spelled variable name becomes a completely NEW variable, and that can cause errors that you will be unable to find, easily.

Arthur Wood

0
 

Author Comment

by:Malek103197
ID: 6930219
OK, I'll give you the points with thanks to Arthur Wood for helping with the Option expilict thing.

Thanks
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now