Solved

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

Posted on 2002-04-09
7
812 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

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…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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