Added: November/10/2004 at 10:48am | IP Logged
|
|
|
If you wanted it all the same page redirections would not really be used. You would simply break the pages into modes or something..
If Request("Mode") = "ShowForm" Then
End If
If Request("Mode") = "SaveForm" Then
End If
Then your form would simply post back to the same page passing the mode as a hidden value which would probably be Mode and "SaveForm"
Now, when the save code was hit and you were done with the page you could display whatever you like or possibly redirect them somewhere else if you wanted. That would be the only time you might want to use a redirect.
How complex all of this gets really depends on you.. for beginners it is often much easier to just use seperate pages and combine them together later on... The nice thing about having it all in the same page of code is that it makes displaying input errors a lot easier because you never have to redirect them back the page the form is on.
On the other hand the nice thing about keeping it all seperate is that it is easier to understand the code and others may be able to edit it easier in the future. It really all depends on what you want to do. I keep them seperate in most of the applications I sell because I find that most of my customers do not know a lot about ASP and it makes it a lot easier for them to undertand what is going on and actually be able to edit the code.
There are plenty of article on all of this around the net if you do some google searches and what not.
etc etc etc
Edited by cwilliams on November/10/2004 at 10:53am
__________________
Chris Williams
http://www.PowerASP.com
|