Thread: Simple question

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Chicago, IL
    Posts
    85
    Rep Power
    14

    Simple question


    Hello. I am new to asp and have a basic quesion. How do I pass a variable through a hyperlink?

    I know in CFMX it's <a href="page.cfm?variable=#variable#>

    Can anyone tell me the syntax to do this in ASP?

    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Shimonoseki / JAPAN
    Posts
    58
    Rep Power
    12
    same

    but variable must be plain, without [#]
    Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
    Gilmour
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Chicago, IL
    Posts
    85
    Rep Power
    14

    Follow up question - URL variables into a form


    Ok. Thanks. Once I get to the page.asp?variable=variable, how to I insert the value into a formfield? I want to have three form fields, two blank for user's first name and last name then one autofilled with the variable that was passed in the URL.

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Shimonoseki / JAPAN
    Posts
    58
    Rep Power
    12
    Code:
    <% passedValue = Request.QueryString("variable") %>
    
    and lets say your form field type is text:
    
    <Input Type="text" Name="Text1" Value="<%= passedValue %>" Size: 20 >
    Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
    Gilmour

IMN logo majestic logo threadwatch logo seochat tools logo