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 > redirecting to itself help?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-05, 20:26
zobernjik zobernjik is offline
Registered User
 
Join Date: Feb 2004
Location: Australia
Posts: 183
redirecting to itself help?

HI guys, by reading posts in this forum I have changed my web page so when users submit the data the page doesn't get redirected but it submits to itself, so visibly it clear the values and submits and they are happy as that speeds up the process but what I haven't relized up until now is that because the INSERT query is part of the code on the same page the INSERT is happening every time the page is refreshed or every time the page is accessed/loaded and I get these NULL values.

I mean that is not such a huge problem at the moment, I can see which records where the result of loading/refershing the page and which ones are true submissions but I am thinking it shouldn't be this way.

Can this be done so it doesn't insert null records, how can I change the page so it visibly works the same way but doens't insert nulls.

Hope somebody can help.Thanks
Reply With Quote
  #2 (permalink)  
Old 02-15-05, 22:21
DMWCincy DMWCincy is offline
Registered User
 
Join Date: May 2004
Posts: 125
I'm assuming when you redirect to the page it is with a form submit. If that is true you can put in code to look for that.

Lets say you have a button call submit:

<input type="submit" name="cmdSubmit" value="Submit">

put in code around the insert like so:

if request.form("cmdSubmit") = "Submit" then
'do your insert stuff here
end if


HTH
DMWCincy
Reply With Quote
  #3 (permalink)  
Old 02-17-05, 02:13
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
<<
I'm assuming when you redirect to the page it is with a form submit. If that is true you can put in code to look for that.
>>

I agree, and here's a little something else I put together along the same lines:

Classic ASP Design Tips - Post Back Page
http://www.bullschmidt.com/devtip-postbackpage.asp
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
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