Need Help with Response.Redirect!!!!!

Results 1 to 7 of 7

Thread: Need Help with Response.Redirect!!!!!

  1. #1
    Join Date
    Dec 1969

    Default Need Help with Response.Redirect!!!!!

    Here is the Scenario.<BR><BR>Page1.asp - has a hidden field called RecordID. Before submitting the page, i set the RecordID to 15 (for example).<BR>OnAction="ProcessRequest.asp"<BR><BR> ProcessRequest.asp -- simply calls Response.Redirect "Page2.asp"<BR><BR>Page2.asp - has a text box which should disply the RecordID <BR>like following:<BR>&#060;% temp = Request.Form("RecordID")%&#062;<BR>&#060;input type="text" value="&#060;%=temp%&#062;" name="TextBox"&#062;<BR><BR>No value gets displayed in Page2.asp.<BR>I spent some time and just can&#039t go on figuring out by myself.<BR>Someone please help me out!<BR>Thanks,<BR>Tammy

  2. #2
    Ganius Tanuel Guest

    Default RE: Need Help with Response.Redirect!!!!!

    Similar to my question: "Redirect POST data to another URL" which is still not solved.<BR><BR>In a page when redirecting to another page, form data submitted to it can&#039t be redirected automatically to the next page. If you don&#039t mind showing the hidden RecordID in the URL as a querystring, following approach might help:<BR><BR>In Page1.asp calls Response.Redirect "Page2.asp?RecordID=" & Request.Form(RecordID)<BR>And in Page2.asp we can get RecordID in the querystring:<BR>&#060;% temp = Request.QueryString("RecordID")%&#062;<BR>&#060;in put type="text" value="&#060;%=temp%&#062; name="TextBox"&#062;<BR><BR>But still, the scheme above will redirect only the RecordID field, while another field (if any) in the first page would not be redirected. Once again, if you don&#039t mind showing the data in the URL address (in the form "Page2.asp?xx=xxx&yy=abc+def...") you can manually re-put the form data in Response.Redirect in Page1.asp.<BR><BR>Another alternative is to use cookie/session variables. In Page1.asp put all the Request.Form data to session/cookie before redirecting to Page2.asp, then in Page2.asp, grab the data from the cookie/session.<BR><BR>Hth, regards.<BR>.Gt

  3. #3
    Leungas Guest

    Default RE: Need Help with Response.Redirect!!!!!

    use Response.Redirect "Page2.asp?RecordID=" & Request.Form("RecordID") instead<BR><BR>

  4. #4
    Leungas Guest

    Default RE: Need Help with Response.Redirect!!!!!

    How about,<BR><BR>In ProcessRequest.asp page, have a form with all the hidden fields with the field from page 1 and submit that to page2.asp?

  5. #5
    Ganius Tanuel Guest

    Default RE: Need Help with Response.Redirect!!!!!

    Yes, with help of JavaScript (client-side script) which is supported by most used browser.<BR><BR>In ProccessRequest.asp (or Page1.asp) define a blank ASP page containing only a form with hidden field with data defined. In the same page, put client-side script at BODY ONLOAD event to invoke the form submission. The form action is to Page2.asp, then you don&#039t have to change the code in Page2.asp.<BR>A little tips, don&#039t depend on the client-side script, in Page1.asp put the form submit button and show a message telling if his/her browser doesn&#039t support client-side scripting, he/she has to click the button manually.<BR><BR>Good luck,<BR>.Gt

  6. #6
    Al Chuck Guest

    Default RE: Need Help with Response.Redirect!!!!!

    Did you turn Response.Buffer=true at the head of your programme before html or is it befor &#060;head&#062; , to use Response.Redirect in the middle of the code you need to do this<BR>good luck

  7. #7
    Al Chuck Guest

    Default RE: Need Help with Response.Redirect!!!!!

    see my response to the earlier thread

Posting Permissions

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