Home | Advertising Info38 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: form redirection at the same page A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
mjunior
Newbie
Newbie
Avatar

Joined: November/06/2004
Location: Brazil
Online Status: Offline
Info: 27
Added: November/09/2004 at 1:06pm | IP Logged Quote mjunior

Hi guys,

I'd like to know how to use a IF-Then-Else statement to redirect the action on the page to an specific form on it.
I decide to use a huge page including all the forms on it instead to redirect to another .asp page. Now I need to know how to surf between the form names...

__________________
mjunior(dumb)
Back to Top View mjunior's Profile Search for other info by mjunior
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: November/10/2004 at 10:48am | IP Logged Quote cwilliams

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
Back to Top View cwilliams's Profile Search for other info by cwilliams
 
mjunior
Newbie
Newbie
Avatar

Joined: November/06/2004
Location: Brazil
Online Status: Offline
Info: 27
Added: November/22/2004 at 6:29pm | IP Logged Quote mjunior

Tnanks buddy!
I kept your advice and split the page in nine pieces...
What I wonder know if you could help me again is how to change some form exibition according to an If statement..including or excluding two or three input fields on it..
Can you show me?

__________________
mjunior(dumb)
Back to Top View mjunior's Profile Search for other info by mjunior
 
elija
Newbie
Newbie
Avatar

Joined: September/04/2004
Location: United Kingdom
Online Status: Offline
Info: 8
Added: December/13/2004 at 8:27am | IP Logged Quote elija

To include stuff (any stuff) based on an if...

if test = condition then
  stuff to include
end if

To exclude stuff (any stuff) based on an if...

if test <> condition then
  stuff to exclude
end if

You can combine this with the else which will do one or the other, but not both...

if test = condition  then
    do stuff
else
    do other stuff
end if

Microsodt has some excellent vbscript / jscript documentation available for free download ar http://www.microsoft.com/downloads/details.aspx?FamilyID =01592c48-207d-4be1-8a76-1c4099d7bbb9&displaylang=en

Its worth getting..

Hope this helps

Elija


__________________
Programmer - a device for turning coffee into algorithms
Back to Top View elija's Profile Search for other info by elija Visit elija's Homepage
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com