473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get URL variable on .asp page with ASP or JS

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
Jul 19 '05 #1
2 2300
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" <se*****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
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

Jul 19 '05 #2
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.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable...
11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
4
by: Bob T | last post by:
Hi All, I am trying to pass a variable from my VB asp.net script (from for example Sub Page_Load in mypage.aspx.vb) to my Client side script. I have found and looked at a very good example...
2
by: Todd | last post by:
Here's one that has been stumping people: I'm writing in ASPX with VB.NET On the login page I set the entered usename text to a session variable....
8
by: hb | last post by:
Hi, I need to declare a variable who's value can be preserve through the same ASP.Net page. I tried the following code, only the static variable s2 keeps its value=22 after lnk1_Click followed...
7
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
9
by: Shapper | last post by:
Hello, I am declaring a variable in my aspx.vb code as follows: Public Class catalogue Public productid As String Private Sub Page_Load ... I have an image button where I call the...
4
by: Sandeep Singh | last post by:
I m building an application in which I redirect the user to a particular page. In the Page Load event of the that page , I assign a variable some value. Then I call the Button click event on that...
7
by: Max | last post by:
Please somebody can shed a light... How can I have a variable visible and modifiable, inside one and only webform? I mean , I d like to see that variable from all the Sub of that webform code,...
2
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.