Professional Web Applications Themes

Passing a second value in a variable - ASP

Two or querysting variables can be passed by separateing them with an ampersand: page.asp?p1=1&p2=2 HTH, Bob Barrows Raphael Gluck wrote: > Hi i am not sure if i headed that correctly, but i am trying to pass a > variable from one page to the next, using > > <td> > <a href="sublisting.asp?Item_ID=<%=rsListing("Item_ID ") %>"> > <%= rsListing("Text_Spec")%> </a> </td> > > This is where rsListing("Item_ID") is the key that is being passed, > when the user clicks on what appears from the Text_spec Field. I also > want to pass another field, but i dont know how, Do i ...

  1. #1

    Default Re: Passing a second value in a variable

    Two or querysting variables can be passed by separateing them with an
    ampersand:
    page.asp?p1=1&p2=2
    HTH,
    Bob Barrows
    Raphael Gluck wrote:
    > Hi i am not sure if i headed that correctly, but i am trying to pass a
    > variable from one page to the next, using
    >
    > <td>
    > <a href="sublisting.asp?Item_ID=<%=rsListing("Item_ID ") %>">
    > <%= rsListing("Text_Spec")%> </a> </td>
    >
    > This is where rsListing("Item_ID") is the key that is being passed,
    > when the user clicks on what appears from the Text_spec Field. I also
    > want to pass another field, but i dont know how, Do i add it on the
    > the end of Item_ID")%>"> or somwhere in the middle? and do i need a
    > special sign to tell the page it's being added, like an & or similar.
    > the field i am trying to pass is called tblTexSpec.TexSpecID
    >
    > Can someone show me how to add it to that <a href> tag, please?
    >
    > Many thanks
    >
    > Raphael

    Bob Barrows Guest

  2. #2

    Default Re: Passing a second value in a variable

    And this answer has a little something about the idea of using
    Server.URLEncode().

    Example URL with a querystring:
    [url]http://www.mysite.com/mydir/mypg.asp?myvar1=hey&myvar2=ho[/url]

    Because a variable might contain some odd characters like spaces, it's
    usually a good idea to use Server.URLEncode when creating a querystring
    from a variable:
    <a href="http://www.mysite.com/mypage?id=<%=
    Server.URLEncode(objRS("MyIDFldFromDB")) %>">objRS("MyIDFldFromDB")</a>

    And in the page that is opened you can use Request.QueryString("id") to
    get the value of id.

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt Guest

Similar Threads

  1. Passing a variable
    By Angie2099 in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: June 26th, 02:33 PM
  2. URL Variable Passing
    By DManson in forum Macromedia ColdFusion
    Replies: 0
    Last Post: April 27th, 03:18 PM
  3. passing variable
    By Troy in forum ASP Components
    Replies: 2
    Last Post: June 16th, 07:48 PM
  4. Passing a variable to a URL
    By Starleys webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: January 21st, 04:02 AM
  5. Replies: 7
    Last Post: July 17th, 04:54 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139