473,473 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using ASP variables with HTML

Here is the line that I am using.
response.write("<p style='color:" & Item"'></p>")
the word Item is a variable with hex code in it for color. This is
pretty simple I think, but how can I get this variable to work with
this HTML. Any help would be greatly appreciated.

Thanks
Ryan
Jul 19 '05 #1
4 5700
What isn't working about it? Are you getting an error of some sort? It
seems fine to me, although I'd change the variable name to something along
the lines of sColor.

Ray at work

"Leeper" <jr******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om...
Here is the line that I am using.
response.write("<p style='color:" & Item"'></p>")
the word Item is a variable with hex code in it for color. This is
pretty simple I think, but how can I get this variable to work with
this HTML. Any help would be greatly appreciated.

Thanks
Ryan

Jul 19 '05 #2
"Leeper" <jr******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om...
Here is the line that I am using.
response.write("<p style='color:" & Item"'></p>")
the word Item is a variable with hex code in it for color. This is
pretty simple I think, but how can I get this variable to work with
this HTML. Any help would be greatly appreciated.


You're missing an & after Item:

Response.Write "<p style='color:" & Item & "'></p>")

Regards,
Peter Foti

PS- My general philosophy is that inline styles are bad things. You would
be better off defining a class or ID. Just my 2 cents.
Jul 19 '05 #3
I take back my "It seems fine to me" statement after reading Peter's post.
[;

Ray at work

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:u2********************@tk2msftngp13.phx.gbl.. .
What isn't working about it? Are you getting an error of some sort? It
seems fine to me, although I'd change the variable name to something along
the lines of sColor.

Ray at work

"Leeper" <jr******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om...
Here is the line that I am using.
response.write("<p style='color:" & Item"'></p>")
the word Item is a variable with hex code in it for color. This is
pretty simple I think, but how can I get this variable to work with
this HTML. Any help would be greatly appreciated.

Thanks
Ryan


Jul 19 '05 #4
"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...
"Leeper" <jr******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om...
Here is the line that I am using.
response.write("<p style='color:" & Item"'></p>")
the word Item is a variable with hex code in it for color. This is
pretty simple I think, but how can I get this variable to work with
this HTML. Any help would be greatly appreciated.


You're missing an & after Item:

Response.Write "<p style='color:" & Item & "'></p>")


And I'm missing an opening ( after Write. :) Ooops.

Should be:

Response.Write( "<p style='color:" & Item & "'></p>" )
or
Response.Write "<p style='color:" & Item & "'></p>"

-Peter
Jul 19 '05 #5

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

Similar topics

3
by: Robert | last post by:
Hello, Can anyone help with this? On my online order form, I need to send a few variables to my credit-card processor. These variables are for non-secure customer comments, and will be sent...
7
by: Gary | last post by:
I haver a table of students - Say 100 students that I need to be able to update/delete and amend. I know I can do this one student at a time which is simple but lets say I want to see all the...
28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
15
by: lawrence | last post by:
Sorry for the dumb question but I'm new to Javascript. I wrote this script hoping to animate some div blocks on a page. You can see the page here: http://www.keymedia.biz/demo.htm Can anyone...
2
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document...
17
by: Davíð Þórisson | last post by:
now in my web I have some global variables to be used in many different subpages, in the old ASP I simply loaded a variables.asp file into memory using the eval() function. Now I'd like to use XML...
10
by: Coleen | last post by:
Hi all :-) I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML. Here is the snippet of code for the cell I'm trying to format: Dim...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
13
by: Andy Baxter | last post by:
Can anyone recommend a good online guide to using objects in javascript? The book I bought (DHTML Utopia) suggests using objects to keep the code clean and stop namespace clashes between different...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.