Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: response.redirect previous data


Message #1 by "Tim Lyons" <lyno@h...> on Tue, 16 Jul 2002 15:37:17
on my newUser.asp page, the user enters pertinent information (username, 
password, email, etc). after submission, the addUser.asp page checks to 
see make sure that the passwords are the same and if not redirects to the 
previous page, newUser.asp.  my question is: when the user is redirected 
back to the previous page, how do i keep the information they just typed 
in, in the forms becuase right now it just erases each form, so they have 
to type it back in. any ideas????

thx,
TL
Message #2 by "Johnson, Israel" <IJohnson@R...> on Tue, 16 Jul 2002 10:39:17 -0400
In your redirect, have the information append to the url.  
<%
Dim URLINFO 
URLINFO = "username=" & request.form("username") & "&password=" &
request.form("password") "

	response.redirect "url.asp?" & URLINFO
%>
-----Original Message-----
From: Tim Lyons [mailto:lyno@h...] 
Sent: Tuesday, July 16, 2002 11:37 AM
To: Access ASP
Subject: [access_asp] response.redirect previous data


on my newUser.asp page, the user enters pertinent information (username, 
password, email, etc). after submission, the addUser.asp page checks to 
see make sure that the passwords are the same and if not redirects to the 
previous page, newUser.asp.  my question is: when the user is redirected 
back to the previous page, how do i keep the information they just typed 
in, in the forms becuase right now it just erases each form, so they have 
to type it back in. any ideas????

thx,
TL
Message #3 by jake williamson 28 <jake.williamson@2...> on Tue, 16 Jul 2002 15:49:20 +0100
depends on if your using post get and where the code checks the username
password.

if the checking code is on the 1st page (ie it submits to itself before
redirecting) you could set cookies on that page if not you could use form
requests on the next page, change them into cookies and request them on the
1st page.

wow! confused myself... did something very similar on a login page though so
if you want the code, give me a shout,

jake


on 16/7/02 3:37 pm, Tim Lyons at lyno@h... wrote:

> on my newUser.asp page, the user enters pertinent information (username,
> password, email, etc). after submission, the addUser.asp page checks to
> see make sure that the passwords are the same and if not redirects to the
> previous page, newUser.asp.  my question is: when the user is redirected
> back to the previous page, how do i keep the information they just typed
> in, in the forms becuase right now it just erases each form, so they have
> to type it back in. any ideas????
> 
> thx,
> TL

Message #4 by "Larry Woods" <larry@l...> on Tue, 16 Jul 2002 08:32:56 -0700
I don't see how this will work!  Please explain.  As far as I
know, adding parameters to a redirected URL doesn't do anything
with the parameters!  To preserve the values you will have to
build a new HTML document with the values inserted.  To just save
the values for your use you can "hide" the values using INPUT
TYPE="HIDDEN".

Larry Woods


> -----Original Message-----
> From: Johnson, Israel [mailto:IJohnson@R...]
> Sent: Tuesday, July 16, 2002 7:39 AM
> To: Access ASP
> Subject: [access_asp] RE: response.redirect previous data
>
>
> In your redirect, have the information append to the url.
> <%
> Dim URLINFO
> URLINFO = "username=" & request.form("username") &
> "&password=" &
> request.form("password") "
>
> 	response.redirect "url.asp?" & URLINFO
> %>
> -----Original Message-----
> From: Tim Lyons [mailto:lyno@h...]
> Sent: Tuesday, July 16, 2002 11:37 AM
> To: Access ASP
> Subject: [access_asp] response.redirect previous data
>
>
> on my newUser.asp page, the user enters pertinent
> information (username,
> password, email, etc). after submission, the
> addUser.asp page checks to
> see make sure that the passwords are the same and if
> not redirects to the
> previous page, newUser.asp.  my question is: when the
> user is redirected
> back to the previous page, how do i keep the
> information they just typed
> in, in the forms becuase right now it just erases each
> form, so they have
> to type it back in. any ideas????
>
> thx,
> TL
>

Message #5 by "Darrell" <darrell@b...> on Tue, 16 Jul 2002 20:37:02 +0100
Hi Tim

If I understand you right you could save your self a lot of hassle here and
use a simple client side JavaScript to check the passwords:
{
if (password1 != password2 || password =="")
}
alert ("Passwords do not match")

Cheers
Darrell




-----Original Message-----
From: Tim Lyons [mailto:lyno@h...]
Sent: 16 July 2002 15:37
To: Access ASP
Subject: [access_asp] response.redirect previous data


on my newUser.asp page, the user enters pertinent information (username,
password, email, etc). after submission, the addUser.asp page checks to
see make sure that the passwords are the same and if not redirects to the
previous page, newUser.asp.  my question is: when the user is redirected
back to the previous page, how do i keep the information they just typed
in, in the forms becuase right now it just erases each form, so they have
to type it back in. any ideas????

thx,
TL

Message #6 by "Ken Schaefer" <ken@a...> on Wed, 17 Jul 2002 11:48:28 +1000
Tim,

This is my suggestion:
www.adopenstatic.com/resources/code/UIValidation.asp

Post the page to itself. Validate everything. If everything is OK, then
redirect to the next page. If there are errors then reload the existing
page, repopulating the form using the Request.Form() collection (see the
pages above for much more detailed discussion on how to do this)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Tim Lyons" <lyno@h...>
Subject: [access_asp] response.redirect previous data


: on my newUser.asp page, the user enters pertinent information (username,
: password, email, etc). after submission, the addUser.asp page checks to
: see make sure that the passwords are the same and if not redirects to the
: previous page, newUser.asp.  my question is: when the user is redirected
: back to the previous page, how do i keep the information they just typed
: in, in the forms becuase right now it just erases each form, so they have
: to type it back in. any ideas????

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #7 by "Ken Schaefer" <ken@a...> on Wed, 17 Jul 2002 11:52:57 +1000
Larry wrote:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Larry Woods" <larry@l...>
Subject: [access_asp] RE: response.redirect previous data


: I don't see how this will work!  Please explain.  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

in response to Israel's post:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > From: Johnson, Israel [mailto:IJohnson@R...]
: > Subject: [access_asp] RE: response.redirect previous data
: >
: > In your redirect, have the information append to the url.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Larry why don't you just try it and see?!?

<%
If LCase(Request.ServerVariables("Request_Method")) = "post" then
    
    ' Form was posted, so 
    ' Response.Redirect back to this page
    ' but we'll append something to the end
    Response.Redirect(Request.ServerVariables("Script_Name") & "?ID=1")

End If
%>
<html>
    <head></head>
    <body>
        <form method="post">
            <input type="submit">
        </form>
    <%
    If LCase(Request.ServerVariables("Request_Method")) <> "post" then

        Response.Write(Request.QueryString("ID"))

    End If
    %>
    </body>
</html>

Now hit the submit button...

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Larry Woods" <larry@l...>
Subject: [access_asp] RE: response.redirect previous data


: I don't see how this will work!  Please explain.  As far as I
: know, adding parameters to a redirected URL doesn't do anything
: with the parameters!  To preserve the values you will have to
: build a new HTML document with the values inserted.  To just save
: the values for your use you can "hide" the values using INPUT
: TYPE="HIDDEN".
: 
: Larry Woods
: 
: 
: > -----Original Message-----
: > From: Johnson, Israel [mailto:IJohnson@R...]
: > Sent: Tuesday, July 16, 2002 7:39 AM
: > To: Access ASP
: > Subject: [access_asp] RE: response.redirect previous data
: >
: >
: > In your redirect, have the information append to the url.
: > <%
: > Dim URLINFO
: > URLINFO = "username=" & request.form("username") &
: > "&password=" &
: > request.form("password") "
: >
: > response.redirect "url.asp?" & URLINFO
: > %>


Message #8 by "Larry Woods" <larry@l...> on Wed, 17 Jul 2002 04:48:36 -0700
Sorry, Ken.  I stand by my statements.  I KNOW that technically
you can return parameters with a URL but it doesn't do ANYTHING!
You can't retrieve the values from the parameter list of the URL
at the browser.  So, what is the point of sending the values?
Any subsequent form submit will override the returned values.
That is what I was trying to point out in my response.

Larry Woods

> -----Original Message-----
> From: Ken Schaefer [mailto:ken@a...]
> Sent: Tuesday, July 16, 2002 6:53 PM
> To: Access ASP
> Subject: [access_asp] RE: response.redirect previous data
>
>
> Larry wrote:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Larry Woods" <larry@l...>
> Subject: [access_asp] RE: response.redirect previous data
>
>
> : I don't see how this will work!  Please explain.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> in response to Israel's post:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : > From: Johnson, Israel [mailto:IJohnson@R...]
> : > Subject: [access_asp] RE: response.redirect previous data
> : >
> : > In your redirect, have the information append to the url.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Larry why don't you just try it and see?!?
>
> <%
> If LCase(Request.ServerVariables("Request_Method")) 
> "post" then
>
>     ' Form was posted, so
>     ' Response.Redirect back to this page
>     ' but we'll append something to the end
>
> Response.Redirect(Request.ServerVariables("Script_Name"
> ) & "?ID=1")
>
> End If
> %>
> <html>
>     <head></head>
>     <body>
>         <form method="post">
>             <input type="submit">
>         </form>
>     <%
>     If
> LCase(Request.ServerVariables("Request_Method")) <> "post" then
>
>         Response.Write(Request.QueryString("ID"))
>
>     End If
>     %>
>     </body>
> </html>
>
> Now hit the submit button...
>
> Cheers
> Ken
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Larry Woods" <larry@l...>
> Subject: [access_asp] RE: response.redirect previous data
>
>
> : I don't see how this will work!  Please explain.  As far as I
> : know, adding parameters to a redirected URL doesn't
> do anything
> : with the parameters!  To preserve the values you will have to
> : build a new HTML document with the values inserted.
> To just save
> : the values for your use you can "hide" the values using INPUT
> : TYPE="HIDDEN".
> :
> : Larry Woods
> :
> :
> : > -----Original Message-----
> : > From: Johnson, Israel [mailto:IJohnson@R...]
> : > Sent: Tuesday, July 16, 2002 7:39 AM
> : > To: Access ASP
> : > Subject: [access_asp] RE: response.redirect previous data
> : >
> : >
> : > In your redirect, have the information append to the url.
> : > <%
> : > Dim URLINFO
> : > URLINFO = "username=" & request.form("username") &
> : > "&password=" &
> : > request.form("password") "
> : >
> : > response.redirect "url.asp?" & URLINFO
> : > %>
>
>
>
>

Message #9 by "Ken Schaefer" <ken@a...> on Thu, 18 Jul 2002 11:19:20 +1000
What are you talking about?

The original poster wanted to "validate" the username/password combination,
and if it was invalide, then redirect back to the first page and passing the
values the user original entered so that the form could be repopulated.

<%
Response.Redirect("loginpage.asp?User=" & strUserName)
%>

and then on the first page, you could do:

<input type="text" name="txtUserName"
value="<%=Request.QueryString("User")%>">

and the input text box would be filled in with whatever value was passed via
the querystring.

Cheers
Ken


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Larry Woods" <larry@l...>
Subject: [access_asp] RE: response.redirect previous data


: Sorry, Ken.  I stand by my statements.  I KNOW that technically
: you can return parameters with a URL but it doesn't do ANYTHING!
: You can't retrieve the values from the parameter list of the URL
: at the browser.  So, what is the point of sending the values?
: Any subsequent form submit will override the returned values.
: That is what I was trying to point out in my response.
:
: Larry Woods
:
: > -----Original Message-----
: > From: Ken Schaefer [mailto:ken@a...]
: > Sent: Tuesday, July 16, 2002 6:53 PM
: > To: Access ASP
: > Subject: [access_asp] RE: response.redirect previous data
: >
: >
: > Larry wrote:
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > From: "Larry Woods" <larry@l...>
: > Subject: [access_asp] RE: response.redirect previous data
: >
: >
: > : I don't see how this will work!  Please explain.
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: >
: > in response to Israel's post:
: >
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > : > From: Johnson, Israel [mailto:IJohnson@R...]
: > : > Subject: [access_asp] RE: response.redirect previous data
: > : >
: > : > In your redirect, have the information append to the url.
: >
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: >
: > Larry why don't you just try it and see?!?
: >
: > <%
: > If LCase(Request.ServerVariables("Request_Method")) 
: > "post" then
: >
: >     ' Form was posted, so
: >     ' Response.Redirect back to this page
: >     ' but we'll append something to the end
: >
: > Response.Redirect(Request.ServerVariables("Script_Name"
: > ) & "?ID=1")
: >
: > End If
: > %>
: > <html>
: >     <head></head>
: >     <body>
: >         <form method="post">
: >             <input type="submit">
: >         </form>
: >     <%
: >     If
: > LCase(Request.ServerVariables("Request_Method")) <> "post" then
: >
: >         Response.Write(Request.QueryString("ID"))
: >
: >     End If
: >     %>
: >     </body>
: > </html>
: >
: > Now hit the submit button...
: >
: > Cheers
: > Ken
: >
: >
: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > From: "Larry Woods" <larry@l...>
: > Subject: [access_asp] RE: response.redirect previous data
: >
: >
: > : I don't see how this will work!  Please explain.  As far as I
: > : know, adding parameters to a redirected URL doesn't
: > do anything
: > : with the parameters!  To preserve the values you will have to
: > : build a new HTML document with the values inserted.
: > To just save
: > : the values for your use you can "hide" the values using INPUT
: > : TYPE="HIDDEN".
: > :
: > : Larry Woods
: > :
: > :
: > : > -----Original Message-----
: > : > From: Johnson, Israel [mailto:IJohnson@R...]
: > : > Sent: Tuesday, July 16, 2002 7:39 AM
: > : > To: Access ASP
: > : > Subject: [access_asp] RE: response.redirect previous data
: > : >
: > : >
: > : > In your redirect, have the information append to the url.
: > : > <%
: > : > Dim URLINFO
: > : > URLINFO = "username=" & request.form("username") &
: > : > "&password=" &
: > : > request.form("password") "
: > : >
: > : > response.redirect "url.asp?" & URLINFO
: > : > %>
: >
: >
: >
: >
:
:

Message #10 by "Larry Woods" <larry@l...> on Wed, 17 Jul 2002 19:37:50 -0700
I stand corrected, Ken.  After rereading the original questions,
etc. I realize that I was confused about what was wanted.

Sorry.

Larry Woods


> -----Original Message-----
> From: Ken Schaefer [mailto:ken@a...]
> Sent: Wednesday, July 17, 2002 6:19 PM
> To: Access ASP
> Subject: [access_asp] RE: response.redirect previous data
>
>
> What are you talking about?
>
> The original poster wanted to "validate" the
> username/password combination,
> and if it was invalide, then redirect back to the
> first page and passing the
> values the user original entered so that the form
> could be repopulated.
>
> <%
> Response.Redirect("loginpage.asp?User=" & strUserName)
> %>
>
> and then on the first page, you could do:
>
> <input type="text" name="txtUserName"
> value="<%=Request.QueryString("User")%>">
>
> and the input text box would be filled in with
> whatever value was passed via
> the querystring.
>
> Cheers
> Ken
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Larry Woods" <larry@l...>
> Subject: [access_asp] RE: response.redirect previous data
>
>
> : Sorry, Ken.  I stand by my statements.  I KNOW that
> technically
> : you can return parameters with a URL but it doesn't
> do ANYTHING!
> : You can't retrieve the values from the parameter
> list of the URL
> : at the browser.  So, what is the point of sending the values?
> : Any subsequent form submit will override the returned values.
> : That is what I was trying to point out in my response.
> :
> : Larry Woods
> :
> : > -----Original Message-----
> : > From: Ken Schaefer [mailto:ken@a...]
> : > Sent: Tuesday, July 16, 2002 6:53 PM
> : > To: Access ASP
> : > Subject: [access_asp] RE: response.redirect previous data
> : >
> : >
> : > Larry wrote:
> : > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : > From: "Larry Woods" <larry@l...>
> : > Subject: [access_asp] RE: response.redirect previous data
> : >
> : >
> : > : I don't see how this will work!  Please explain.
> : > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : >
> : > in response to Israel's post:
> : >
> : > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : > : > From: Johnson, Israel [mailto:IJohnson@R...]
> : > : > Subject: [access_asp] RE: response.redirect
> previous data
> : > : >
> : > : > In your redirect, have the information append
> to the url.
> : >
> : > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : >
> : > Larry why don't you just try it and see?!?
> : >
> : > <%
> : > If LCase(Request.ServerVariables("Request_Method")) 
> : > "post" then
> : >
> : >     ' Form was posted, so
> : >     ' Response.Redirect back to this page
> : >     ' but we'll append something to the end
> : >
> : > Response.Redirect(Request.ServerVariables("Script_Name"
> : > ) & "?ID=1")
> : >
> : > End If
> : > %>
> : > <html>
> : >     <head></head>
> : >     <body>
> : >         <form method="post">
> : >             <input type="submit">
> : >         </form>
> : >     <%
> : >     If
> : > LCase(Request.ServerVariables("Request_Method"))
> <> "post" then
> : >
> : >         Response.Write(Request.QueryString("ID"))
> : >
> : >     End If
> : >     %>
> : >     </body>
> : > </html>
> : >
> : > Now hit the submit button...
> : >
> : > Cheers
> : > Ken
> : >
> : >
> : > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : > From: "Larry Woods" <larry@l...>
> : > Subject: [access_asp] RE: response.redirect previous data
> : >
> : >
> : > : I don't see how this will work!  Please explain.
>  As far as I
> : > : know, adding parameters to a redirected URL doesn't
> : > do anything
> : > : with the parameters!  To preserve the values you
> will have to
> : > : build a new HTML document with the values inserted.
> : > To just save
> : > : the values for your use you can "hide" the
> values using INPUT
> : > : TYPE="HIDDEN".
> : > :
> : > : Larry Woods
> : > :
> : > :
> : > : > -----Original Message-----
> : > : > From: Johnson, Israel [mailto:IJohnson@R...]
> : > : > Sent: Tuesday, July 16, 2002 7:39 AM
> : > : > To: Access ASP
> : > : > Subject: [access_asp] RE: response.redirect
> previous data
> : > : >
> : > : >
> : > : > In your redirect, have the information append
> to the url.
> : > : > <%
> : > : > Dim URLINFO
> : > : > URLINFO = "username=" & request.form("username") &
> : > : > "&password=" &
> : > : > request.form("password") "
> : > : >
> : > : > response.redirect "url.asp?" & URLINFO
> : > : > %>
> : >
> : >
> : >
> : >
> :
> :
>
>
>


  Return to Index