Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Get URL variable on .asp page with ASP or JS

Reply
Thread Tools

Get URL variable on .asp page with ASP or JS

 
 
Charles
Guest
Posts: n/a
 
      09-12-2004
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=1234 5&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


 
Reply With Quote
 
 
 
 
Charles
Guest
Posts: n/a
 
      09-12-2004
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=<%=v ard%>&vare=fixed"
(you had ommited the "vard=" piece).

Thanks.
Charles

"senthil" <> wrote in message
news:693E34AE-0EB4-4BD3-A03D-...
> 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=1234 5&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
>>
>>
>>



 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      09-13-2004
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if instance variable get initialize after assigning some values or after constructor then when does static variable get initialize Tony Morris Java 3 02-04-2006 08:39 AM
how to get javascript variable value into asp variable tnhoe Javascript 4 04-21-2005 06:32 PM
Receiving values from ASP page to ASP.NET page in URL =?Utf-8?B?Q2hyaXM=?= ASP .Net 2 01-31-2005 09:33 PM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments
 



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