Passing a Variable through Response.Redirect

Results 1 to 2 of 2

Thread: Passing a Variable through Response.Redirect

  1. #1
    Join Date
    Dec 1969
    Posts
    736

    Default Passing a Variable through Response.Redirect

    Hi.<BR>I am trying to pass a Variable through the Response.Redirect object as such:<BR><BR>&#060;%<BR>Dim FSTname, LSTname<BR>FSTname = Request.Form("firstname")<BR>LSTname = Request.Form("lastname")<BR><BR>If FSTname = "" Then<BR>Response.Redirect "registration.asp?action=nofirstname&lastname=LSTn ame"<BR>%&#062;<BR><BR>Is this possible? I know that I could use javascript and its history function, but I am trying to keep all of my data checking as server-side functions. I would be grateful for any help!<BR>-Ian<BR><BR><BR><BR><BR><BR>

  2. #2
    ASP_DRUG_DEALER Guest

    Default RE: Passing a Variable through Response.Redirect

    Hey Ian,<BR><BR>Just send it back to the same page. Here&#039s an example...<BR>Hope this helps,<BR>DRUG_DEALER<BR><BR>****register.asp****< BR>&#060;%<BR>Dim FName,LName,intState,strError<BR>&#039check to see if user has already been here.<BR>intState = cint(Request.QueryString("intState"))<BR>If intState &#062; 1 Then<BR> &#039do our data checks<BR> FName=Request.Form("firstname")<BR> LName=Request.Form("lastname")<BR> strError=""<BR> If FName="" Then<BR> strError= strError & "Please Enter a First Name."<BR> End If<BR> If LName="" Then<BR> strError=strError & "Please Enter a Last Name"<BR> End if<BR> If strError = "" then<BR> &#039No errors found.<BR> Response.Redirect("writetoDb.asp")<BR> Else<BR> &#039Error found.<BR> strError = "Missing Required Field!" & strError<BR> End If<BR>End If<BR>%&#062;<BR>&#060;html&#062;<BR>&#060;head&#0 62;&#060;title&#062;Register Here&#060;/title&#062;&#060;/head&#062;<BR>&#060;body&#062;<BR>&#060;!-- display error message,_<BR>if empty nothing will show<BR>--&#062;<BR>&#060;B&#062;&#060;%=strError%&#062;&#06 0;/B&#062;<BR>&#060;!-- set state to 2 when user hits submits --&#062;<BR>&#060;form action="register.asp?intState=2" Method="post"&#062;<BR>First Name:&#060;input type="text" name="firstname" Value="&#060;% = FName%&#062;"&#062;<BR><BR>Last Name:&#060;input type="text" name="lastname" Value="&#060;% = LName%&#062;"&#062;<BR><BR>&#060;input type="submit" Value="submit"&#062;<BR>&#060;/form&#062;<BR><BR>&#060;/body&#062;<BR>&#060;/html&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •