[thelist] VARIABLE(s): asp/vbscript (referencing/pointers)

Scott Schrantz scotts at rci-nv.com
Wed Jun 26 15:04:01 CDT 2002


> page1.asp contains the form the user will be filling out and also
> include's the error message(s).  the "processing" page called page2.asp
> will redirect the user if an error is found in the form with this...
> Response.Redirect("page1.asp?errMsg=C_Err1")

How about putting the error messages in an array?

 Dim ar_Err(5)
 ar_Err(0) = "You suck and the form field is blank. Please reenter it."
 ar_Err(1) = "You're ugly, please fix that."

And then...
 Response.Redirect("page1.asp?errMsg=1")

And finally...
 Response.Write ar_Err(CInt(Request("errMsg")))

Or you could put them in a database...
 "SELECT ErrorText FROM tblErrors WHERE ErrorID = " & Request("errMsg") &
";"

If you rethink your problem you can usually come up with an easier solution.
If you're stuck doing it with the constants, though, you could probably use
Eval or Execute.
http://www.4guysfromrolla.com/webtech/030300-1.shtml

--
Scott Schrantz
work: www.rci-nv.com
play: www.computer-vet.com



More information about the thelist mailing list