?
Solved

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

Posted on 2002-04-09
7
Medium Priority
?
836 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Accepted Solution

by:
phuctran earned 400 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

719 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