Going back

Going back

am 21.07.2007 16:35:23 von terryshamir

Hi - I'm doing my first ASP project.

In my App I present one asp page with parameters for a search
(search.asp) - when they do a search the form is posted to another ASP
page (displayresults.asp) which displays the results.
They then select one of search results and submit to another page.

IF the search didn't produce any results I would like the submit
button on the displayresults.asp to sent them back to search.asp so
user can change search parameters.

If I change the displayresults' submit's tag ACTION= "search.asp" when
no results are found, it does correctly repost back to search form -
however I lose the parameters that were typed in.

Is there a way I can RELIABLY mimick the browser backbutton - cos this
keeps the previous user entered parameters.

Second question

How do I stop people typing in ..........\search.asp and loading this
page, you should only be able to get there from a login.asp or from
displayresults.asp..

Thanks

Sorry if I've asked something completely obvious....

Re: Going back

am 21.07.2007 18:24:56 von Jon Paal

create two sub routines - call based upon search results
--one that shows results, if any exist
--second that shows message and back button if no results exist

to prevent direct access, have the search.asp page check for expected form values, if none exist, display message or redirect to
another page.

google for numerous code examples.

asp -.net "back button"
asp -.net redirect
asp -.net subroutines
asp -.net "retrieve form values"
etc.....