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
Solved

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

Posted on 2002-04-09
7
807 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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