www.webdeveloper.com
Results 1 to 6 of 6

Thread: how to pass value to 3rd page?

  1. #1
    Join Date
    Jun 2005
    Posts
    23

    Smile how to pass value to 3rd page?

    hi! i am facing a problem when passing value! the situition is like tis:

    i hav page A, n i will fill in the text filed, after tat i click 1 button

    to page B,
    at here, i doesn;t need the value yet; then i will click a button;

    to page C,
    here i want the value in page A.

    any1 know how to solve this problem? thanks ya...!

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Pass the value from page B to Page C via the Form collection with a hidden form field.

    In Page B:
    Code:
    <input type="hidden" name="someName" value="<%= Request.Form("someName") %>" />
    In Page C:
    Code:
    Dim strValue: strValue = Request.Form("someName")
    Regards.

  3. #3
    Join Date
    Jan 2003
    Location
    USA
    Posts
    688
    Generally speaking you can pass variables from page to page by:

    1) Posting form fields from one page to the next (or to the same page) and on the page to retrieve the value strLName = Request.Form("LName")

    2) Using a querystring such as Response.Redirect "login.asp?lname=smith&fname=tom" and on the page to retrieve the values strLName = Request.QueryString("lname") and strFName = Request.QueryString("fname")

    3) Using session variables such as Session("LName") = "Smith" and on the page to retrieve the value strLName = Session("LName")

    4) Using cookie variables such as Cookie("LName") = "Smith" and on the page to retrieve the value strLName = Cookie("LName")
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  4. #4
    Join Date
    Jun 2005
    Posts
    23

    good idea!

    thanks for giving me the method! i get it now...! izzit tis is the easiest way? but it's good..! hehe..! thanks!

  5. #5
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Generally speaking, it would be easier to store the value at Session scope, but more resource hungry.

    Regards.

  6. #6
    Join Date
    Jan 2005
    Posts
    168
    Hidden form fields/querystrings all the way! It is possibly to write a little routine to loop through the form collection posted to a given page and convert it all into hidden form fields for passing on. Something like:

    PHP Code:
    For Each Item In Request.Form
       Response
    .Write "<input type=""hidden"" name="""&Item&""" value="""&Request.Form(Item)&""" />"
    Next 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles