Get URL variable on .asp page with ASP or JS

Discussion in 'ASP General' started by Charles, Sep 12, 2004.

  1. Charles

    Charles Guest

    I need to retreive a URL variable on a .asp page using either ASP or JS and
    then put in into the URL of an img tag.



    Example:

    - The page we are looking at has URL
    "https://aaa.bbb.net/ccc.asp?var1=12345&var2=True&var3=hello"

    - I need to use JS or ASP to build a tag "<IMG border=10 hspace=10 vspace=10
    width=1 height=1
    src="https://ddd.eee.com/fff.asp?vara=fixed&varb=fixed&varc=fixed&vard=12345&vare=fixed">"

    - Basically, the value of var1 from the URL should be used as the value from
    vard in the img tag



    Your help is appreciated.

    Charles
    Charles, Sep 12, 2004
    #1
    1. Advertising

  2. Charles

    Charles Guest

    Thanks for the tip. I am really unexperienced with ASP. I assume I have to
    enclose the "vard = Request.QueryString("var1")" line with the <% and %>
    tags, correct? I also assume the way to embedd the variable in the img tag
    is
    "https://ddd.eee.com/fff.asp?vara=fixed&varb=fixed&varc=fixed&vard=<%=vard%>&vare=fixed"
    (you had ommited the "vard=" piece).

    Thanks.
    Charles

    "senthil" <> wrote in message
    news:...
    > you can easily do this with asp.
    >
    > You can get the Query string values from the url as
    > querystringvalue = Request.QueryString("stringname")
    > example
    > "https://aaa.bbb.net/ccc.asp?var1=12345&var2=True&var3=hello"
    > with this page
    > vard = Request.QueryString("var1")
    >
    > now you can generate a img take like
    > <IMG border=10 hspace=10 vspace=10
    > width=1 height=1
    >
    > src="https://ddd.eee.com/fff.asp?vara=fixed&varb=fixed&varc=fixed&<%=vard%>&vare=fixed">"
    >
    > Senthil
    >
    >
    >
    > "Charles" wrote:
    >
    >> I need to retreive a URL variable on a .asp page using either ASP or JS
    >> and
    >> then put in into the URL of an img tag.
    >>
    >>
    >>
    >> Example:
    >>
    >> - The page we are looking at has URL
    >> "https://aaa.bbb.net/ccc.asp?var1=12345&var2=True&var3=hello"
    >>
    >> - I need to use JS or ASP to build a tag "<IMG border=10 hspace=10
    >> vspace=10
    >> width=1 height=1
    >> src="https://ddd.eee.com/fff.asp?vara=fixed&varb=fixed&varc=fixed&vard=12345&vare=fixed">"
    >>
    >> - Basically, the value of var1 from the URL should be used as the value
    >> from
    >> vard in the img tag
    >>
    >>
    >>
    >> Your help is appreciated.
    >>
    >> Charles
    >>
    >>
    >>
    Charles, Sep 12, 2004
    #2
    1. Advertising

  3. Charles wrote:
    > I need to retreive a URL variable on a .asp page using either ASP or
    > JS and then put in into the URL of an img tag.


    Asked and answered in microsoft.public.scripting.jscript.
    http://www.aspfaq.com/etiquette.asp?id=5003


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Sep 13, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon paugh
    Replies:
    1
    Views:
    687
  2. Steve Richter

    get url of page that linked to your page

    Steve Richter, Mar 30, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    446
    Steve Richter
    Mar 30, 2005
  3. Just D.
    Replies:
    0
    Views:
    406
    Just D.
    Aug 11, 2004
  4. David Thielen

    Get full url from relative url

    David Thielen, May 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    183
    David Thielen
    May 26, 2006
  5. tnhoe
    Replies:
    4
    Views:
    683
Loading...

Share This Page