473,609 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyperlink color problem in ASP page link

The following html code appears in an ASP page. The hyperlink is set to
white (see the page link color), but when the page renders in IE 6.0, it
initially appears in maroon with a white border around it. When the user
clicks anywhere on the page, it turns white. Does anybody know how I can
make it appear white when the page first renders?

Response.Write( "<html><bod y bgcolor=""#0000 00"" link=""#FFFFFF" "
vlink=""#FFFFFF "">")

Response.Write( "<font color=""#B7CACA "" face=""Arial"" size=""3"">")

Response.Write( "<p>Click the link below:</p></font>")

Response.Write( "<p></p>")

Response.Write( "<p align=""center" "><font face=""Arial"" size=""3""><a
target=""_blank "" href=""../linkpage.htm""> Click this link</a></font></p>")

Response.Write( "</body></html>")


Jul 22 '05 #1
5 2695
Gazing into my crystal ball I observed "Janet" <MD@noemail.com > writing
in news:d1******** @news3.newsguy. com:
The following html code appears in an ASP page. The hyperlink is set
to white (see the page link color), but when the page renders in IE
6.0, it initially appears in maroon with a white border around it.
When the user clicks anywhere on the page, it turns white. Does
anybody know how I can make it appear white when the page first
renders?

Response.Write( "<html><bod y bgcolor=""#0000 00"" link=""#FFFFFF" "
vlink=""#FFFFFF "">")

Response.Write( "<font color=""#B7CACA "" face=""Arial""
size=""3"">")

Response.Write( "<p>Click the link below:</p></font>")

Response.Write( "<p></p>")

Response.Write( "<p align=""center" "><font face=""Arial""
size=""3""><a
target=""_blank "" href=""../linkpage.htm""> Click this
link</a></font></p>")

Response.Write( "</body></html>")



Oh, my! Why oh why! There is no reason to do all this response.write,
just drop out of your script and write plain HTML markup. As a matter of
fact, the snippet above does not even have any reason to use scripting at
all.

Having said that, you need to separate content from presentation. Get rid
of depreciated markup, like FONT and remove the presentational attributes
from the BODY element. By using CSS, you can a) only have to change one
document to change the entire site, b) reduce the size of documents for
faster loading on the client side, c) make debugging a lot easier on
yourself.

See http://www.w3schools.com/css/ for more information on CSS and how to
implement it. The specs are available at http://www.w3.org/TR/REC-CSS2/ ,
and you might find http://www.blooberry.com/indexdot/css/ informative as
well.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #2
Adrienne,

Thanks for your reply, but I must explain. The code is being written by an
asp page within the auspices of Windows Media Rights Manager, and it
displays in the popup html page supplied by Windows Media Player. It has no
choice but to write through "Response.Write ," and as far as I know it can't
use a style sheet. So assuming I'm forced to use the simple html syntax
shown below, do you know why the hyperlink doesn't show in its designated
color when the page first generates? Other simple html code I've written
doesn't have this problem. If there's no other way, maybe I can coerce it
to use a style sheet, but it's one-off page for a specialized purpose.

I should have explained that earlier. Thanks again for any ideas you may
have.

Janet
"Adrienne" <ar********@sbc global.net> wrote in message
news:Xn******** *************** *****@207.115.6 3.158...
Gazing into my crystal ball I observed "Janet" <MD@noemail.com > writing
in news:d1******** @news3.newsguy. com:
The following html code appears in an ASP page. The hyperlink is set
to white (see the page link color), but when the page renders in IE
6.0, it initially appears in maroon with a white border around it.
When the user clicks anywhere on the page, it turns white. Does
anybody know how I can make it appear white when the page first
renders?

Response.Write( "<html><bod y bgcolor=""#0000 00"" link=""#FFFFFF" "
vlink=""#FFFFFF "">")

Response.Write( "<font color=""#B7CACA "" face=""Arial""
size=""3"">")

Response.Write( "<p>Click the link below:</p></font>")

Response.Write( "<p></p>")

Response.Write( "<p align=""center" "><font face=""Arial""
size=""3""><a
target=""_blank "" href=""../linkpage.htm""> Click this
link</a></font></p>")

Response.Write( "</body></html>")



Oh, my! Why oh why! There is no reason to do all this response.write,
just drop out of your script and write plain HTML markup. As a matter of
fact, the snippet above does not even have any reason to use scripting at
all.

Having said that, you need to separate content from presentation. Get rid
of depreciated markup, like FONT and remove the presentational attributes
from the BODY element. By using CSS, you can a) only have to change one
document to change the entire site, b) reduce the size of documents for
faster loading on the client side, c) make debugging a lot easier on
yourself.

See http://www.w3schools.com/css/ for more information on CSS and how to
implement it. The specs are available at http://www.w3.org/TR/REC-CSS2/ ,
and you might find http://www.blooberry.com/indexdot/css/ informative as
well.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jul 22 '05 #3
JDS
On Mon, 14 Mar 2005 16:42:59 -0500, Janet wrote:
It has no
choice but to write through "Response.Write ," and as far as I know it can't
use a style sheet. So assuming I'm forced to use the simple html syntax
shown below, do you know why the hyperlink doesn't show in its designated
color when the page first generates?


Do you HAVE to use <font>? Could you instead do in-line styles?

i.e. replace <font...> with <span style="color:re d"> or somesuch?

--
JDS | je*****@example .invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 22 '05 #4
Thanks for the suggestion. The answer turned out to be the missing "alink"
(for active link). When I added ""alink=#FFFFFF "" to the body header, the
link showed correctly. The span tag didn't work, most likely because this
line deals with a hyperlink, not regular text.

Thanks to both of you for your suggestions.

Janet
"JDS" <je*****@exampl e.invalid> wrote in message
news:pa******** *************** *****@example.i nvalid...
On Mon, 14 Mar 2005 16:42:59 -0500, Janet wrote:
It has no
choice but to write through "Response.Write ," and as far as I know it can't use a style sheet. So assuming I'm forced to use the simple html syntax
shown below, do you know why the hyperlink doesn't show in its designated color when the page first generates?


Do you HAVE to use <font>? Could you instead do in-line styles?

i.e. replace <font...> with <span style="color:re d"> or somesuch?

--
JDS | je*****@example .invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 22 '05 #5
Janet wrote:
Adrienne,

Thanks for your reply, but I must explain. The code is being written by an
asp page within the auspices of Windows Media Rights Manager, and it
displays in the popup html page supplied by Windows Media Player. It has no
choice but to write through "Response.Write ," and as far as I know it can't
use a style sheet. So assuming I'm forced to use the simple html syntax
shown below, do you know why the hyperlink doesn't show in its designated
color when the page first generates? Other simple html code I've written
doesn't have this problem. If there's no other way, maybe I can coerce it
to use a style sheet, but it's one-off page for a specialized purpose.

I should have explained that earlier. Thanks again for any ideas you may
have.

Janet


Well since it I can assume that your are 'Response.Write 'ing the whole
page since your are opening and closing it here....
Response.Write( "<html><bod y bgcolor=""#0000 00"" link=""#FFFFFF" "
vlink=""#FFFFFF "">")

Response.Write( "</body></html>")


then when you 'Response.Write ' the start of the page add code to line to
a style sheet and just wire simple code that will not break in the
future when tags like FONT are no longer supported!

Response.Write( "<html><head><l ink rel=""styleshee t"" type=""text/css""
href=""styleshe etforASPpopups. css""></head><body>")

Response.Write( "<p>Click the link below:</p>")

Response.Write( "<p class="mylinks" >Click the link
below:</p>Response.Writ e("<p><a href=""../linkpage.htm""
target=""_blank "">Click this link</a></p>")

Response.Write( "<p>Click the link below:</p>")
Then create stylesheet 'stylesheetforA SPpopups.css'

BODY {
font-family: Arial, Helvetica, sans-serif;
background-color: #000000;
color: #B7CACA;
}
A {
background-color: #000000;
color: #FFFFFF;
}
..mylinks {
text-align: center;
}

Then if you don't link your BLACK popups with grayish text and white
links your can just change your stylesheet and you do not have to edit
any of your ASP code....

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jul 22 '05 #6

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

Similar topics

5
2069
by: JerryK | last post by:
Hi, I am trying to put a hyperlink to a .cer (certificate) file on a form. Normally (on a ,htm page) when the user clicks on the hyperlink, the file is not recognized and the user is given the option to save the file. This is the desired result. However, when I put the hyperlink on a webform, the file is opened and it's binary contents are displayed on the screen. Does anyone know why this happens? The hyperlink is as follows:
2
2607
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the columns is not databound and instead has up to three hyperlinks in it (Edit, Award, and Cancel). A couple of the hyperlinks should not be shown in certain cases. Now, mind you, I don't know if it's being done in the way that's best to do it. It...
10
1790
by: hecsan07 | last post by:
I am a novice programmer. I want to have a hyperlink that looks like so: www.mycoolsite.com?a=21132. On click I want to extract the query string and use it to query a table within a DB (SQL Server). The stored procedure takes the query string as a parameter and returns the actual URL the page is going to be redirectted. I can do this using a button, but I have done little work with ASP.NET hyperlinks. I've never used a link to query a DB...
6
2939
by: epigram | last post by:
I'm using the DataGrid with AutoGenerateColumns set to false and choosing which columns I want in the grid by using the <Columns> attribute. What I want to do is to create a hyperlink out of one of the columns that I am displaying, but in order to build this link, I need a value that is in my SELECT clause, but is not being displayed via a BoundColumn. Say I have a query: SELECT ID, Name FROM Companies Here, ID is the PK. I am only...
3
15404
by: Tim::.. | last post by:
I currently have the following datagrid but want to turn the name and email column into a hyperlink in the codebehind! Can someone please tell me how I achieve this! Thanks Private Sub createTable() Dim tbcontacts As DataTable = New DataTable("contacts") tbcontacts.Columns.Add(" ", System.Type.GetType("System.String"))
19
3478
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred to here as page_2). I need to cache the value of the link's text (hyperlink.text property) so that I can use it in the page_load event of page_2. I've thought of using a hidden field and then calling Request.Form("hdnClickedLinkText") in the...
3
12355
by: sloesch | last post by:
I am working with VS.net 2003, framework 1.1, developing with VB.net, and ASP.net, and I would like to know how you can create a dynamic hyperlink on the fly to a document stored in a SQL database? I would like to create a VB.net function that would do this, and I found this class *System.Web.UI.WebControls.HyperLink*, but I can not find any examples on generate a dynamic hyperlink. Basically, I want my function to generate an embedded...
2
4991
by: SAL | last post by:
I would like to create a VB.net function, that builds a dynamic hyperlink using System.Web.UI.WebControls.HyperLink, but I can not find any examples on how to generate a dynamic hyperlink. Has anyone done this before? I do not want to dynamically create my hyperlink on an ASP page, but rather a behind the scenes link that a user can paste into a Word document or Email, as an embedded link that points to a particular file. This would be...
20
2987
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is a control. I have 2 files "displayCompanyJobs.aspx" and "displayCompanyOverview.aspx" which are in both the folder "/jobseeker/" and "/employer/". I have a user control "displayCompanyJobs.ascx" that is in my /applicant/
0
8095
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8588
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8410
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7030
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6068
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5526
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4037
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
1407
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.