Hi,
I have a basic question, I am learning asp since a few days ago, so maybe it will be a dumb question... let's go:
I have a form.asp page which consists on a form which gather the data, then triggers update.asp which receives the form values and performs the update on the database.
I would like to prevent update.asp from being called without passing first through the form.asp (let's suppose the user tries to go straight there typing the url of update.asp). It's easy to check that the form values are empty, but once I know it, how do I say "Error" and stop? I've tried with server.abandon() but it doesn't seem to stop the "flow" of commands after it. They keep executing and of course they produce an ugly error which I don't want the user to see (although he deserves it for trying strange things
At last I have used something like this:
if value="" then response.redirect "form.asp"
, so that if there's no value, he gets redirected to the form where he should have came from. But then I have to set the response.buffer to true at the beginning of the document.
My question then is:
1) What is the .abandon() method useful for? Doesn't it stop the processing?
2) Is there any more elegant method than response.redirect + buffer=true for achieving the same result? Or is it already okay? I don't know if using buffer=true might have some negative effects I might be overlooking.
Thanks in advance for any help.
ChX.
I have a basic question, I am learning asp since a few days ago, so maybe it will be a dumb question... let's go:
I have a form.asp page which consists on a form which gather the data, then triggers update.asp which receives the form values and performs the update on the database.
I would like to prevent update.asp from being called without passing first through the form.asp (let's suppose the user tries to go straight there typing the url of update.asp). It's easy to check that the form values are empty, but once I know it, how do I say "Error" and stop? I've tried with server.abandon() but it doesn't seem to stop the "flow" of commands after it. They keep executing and of course they produce an ugly error which I don't want the user to see (although he deserves it for trying strange things
At last I have used something like this:
if value="" then response.redirect "form.asp"
, so that if there's no value, he gets redirected to the form where he should have came from. But then I have to set the response.buffer to true at the beginning of the document.
My question then is:
1) What is the .abandon() method useful for? Doesn't it stop the processing?
2) Is there any more elegant method than response.redirect + buffer=true for achieving the same result? Or is it already okay? I don't know if using buffer=true might have some negative effects I might be overlooking.
Thanks in advance for any help.
ChX.