Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Unanswered: 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

  2. #2
    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

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •