Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 843
  • Last Modified:

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

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
Malek103197
Asked:
Malek103197
  • 3
  • 3
1 Solution
 
phuctranCommented:
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
 
phuctranCommented:
on page1.asp and page2.asp, you should have these lines

<%
  Option explicit
  Response.Buffer = TRUE
  Response.Expires = 0
  Response.ExpiresAbsolute = Now - 1
%>
0
 
Malek103197Author Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
phuctranCommented:
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
 
Malek103197Author Commented:
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
 
Arthur_WoodCommented:
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
 
Malek103197Author Commented:
OK, I'll give you the points with thanks to Arthur Wood for helping with the Option expilict thing.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now