Results 1 to 7 of 7

Thread: Value passing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Question

    Hi,

    How can I send a value from one ASP page to another? Currently, I am doing it using the 'get' method in the FORM tags. Is there another way of sending values?

    Thanks in advance.

  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    You can also use the query string.

    example:
    Code:
    <a href=MyNextPage.asp?MyVar = xyz>Next Page</a>
    In the MyNextPage.asp page, you access the variable
    by using:
    Code:
    <% GetValue = Request.QueryString("MyVar") %>
    You can use also use cookies to pass values.

  3. #3
    New Member
    Join Date
    Feb 2000
    Location
    a
    Posts
    12

    I think what he means is that..

    I think what he means is that some things just dont show up like they do in IE. I had a problem with this when I did my database for a real estate company, just mess around with a few HTML tags and you should be good to go when it looks right. Hope this helps some.
    - azpc

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    just mess around with a few HTML tags and you should be good to go when it looks right
    -huh?


    What your looking for is method=POST

    That will pass the data without displaying it on the URL line. You can access the data on the page receiving the form action by using Request.Form("NameOfInputElement").

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Smile Re: Passing Value

    I actually wanted to collect a value from one page (page A) and use it on two other pages (Page B & C). I used the get method in Page A, and I need the value again together with the new ones I got from Page B in Page C.

    I'll try the POST method though. BTW, do I need to put that in a FORM tag as well?

    Thanks.

  6. #6
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    The syntax is:

    <FORM name=MyForm method=post action=NextPage.asp>

    It sounds like you are going to need to either:

    a) Pass it to page B and write it into a hidden textbox that will be passed to page C from page B

    or
    b) Store the value in a Session Object.

    Depends on where you need to use it on whether or not you can easily use the session object since it only exists on the server side.

    But, you can easily do something like this on page B:

    Code:
    <INPUT type=hidden name=txtValueFromA value="<%=Request.Form("txtMyValue")%>">
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Posts
    80

    Talking

    Thanks monte96. It works

Posting Permissions

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



Click Here to Expand Forum to Full Width