If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Refreshing a form without logging out and logging back in

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-29-04, 20:10
KlansMan KlansMan is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
Refreshing a form without logging out and logging back in

Hi There can some one help me with this bit of code

I have a form for people to update their details and in the update.asp file which run when the user clicks on the update button
i want the details on the form to refresh before the user gets redirected back to the form so they can see the changes with out having to log out and in again

here the code for my update file

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #INCLUDE FILE="Classfd.asp" -->
<%
Dim rsUser
Set rsUser = Server.CreateObject ("ADODB.Recordset")
rsUser.Open "tbl_User", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
rsUser ("Password") = Request.Form ("Password")
rsUser ("FirstName") = Request.Form ("FirstName")
rsUser ("Surname") = Request.Form ("Surname")
rsUser ("DOB") = Request.Form ("DOB")
rsUser ("Address1") = Request.Form ("Address1")
rsUser ("Address2") = Request.Form ("Address2")
rsUser ("Address3") = Request.Form ("Address3")
rsUser ("Address4") = Request.Form ("Address4")
rsUser ("PostCode") = Request.Form ("PostCode")
rsUser ("Country") = Request.Form ("Country")
rsUser ("Email") = Request.Form ("Email")
If Request.Form ("DifferentAddress") = "1" Then
rsUser ("DifferentAddress") = True
Else
rsUser ("DifferentAddress") = False
rsUser ("dAddress1") = Request.Form ("dAddress1")
rsUser ("dAddress2") = Request.Form ("dAddress2")
rsUser ("dAddress3") = Request.Form ("dAddress3")
rsUser ("dAddress4") = Request.Form ("dAddress4")
rsUser ("dPostCode") = Request.Form ("dPostCode")
rsUser ("dCountry") = Request.Form ("dCountry")
rsUser.update
End If
Response.Redirect "MyAccount.asp"
%>

Does anyone have any ideas !
( I thought of ending the session then re-opening it agian but i was not sure how to do this, am I Thinking along the right lines or is there a better way of doing this)

Hope Some Out There Can Help

Regards

KlansMan
Reply With Quote
  #2 (permalink)  
Old 08-30-04, 08:09
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
I think the best would be to allow access to your update page to logged in users only so when they submit the form they are still logged in, if you think they will spend a long time on the form then you can extend the Session time out.
Reply With Quote
  #3 (permalink)  
Old 08-30-04, 21:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Sounds to me like you just need to change your logic flow a little bit...

You are submitting back to the same page yes? If so you just need to make it so it checks for updated data first, does an update if needed and then, gets the data and displays it.... in psuedo code something like...
Code:
if request.form("doUpdate") then
  update database with new info
end if

get info from database

display info
Reply With Quote
  #4 (permalink)  
Old 08-30-04, 23:32
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
KlansMan? Like, THEE Klan.. I surely hope not...
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #5 (permalink)  
Old 08-31-04, 04:43
KlansMan KlansMan is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
Cheers for the bit of advice i'll give it a go

And No it not THEE KLAN.
As in a Scottish Klan.The Klan Mcphee

rokslide

The Form they fill in is MyAccount.asp which they get redirected back to once Update.asp has ran and placed the new information in the datebase
So is there a refresh command which i could place in myAccount.asp just before the form to show any changes

Cheers

KlansMan
Reply With Quote
  #6 (permalink)  
Old 08-31-04, 19:02
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Sounds like you have a problem with caching... add these lines to the start of your page...
Code:
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %> 
<% Response.Expires = -1 %>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On