Hyperlink color problem in ASP page link

Discussion in 'ASP General' started by Janet, Mar 14, 2005.

  1. Janet

    Janet Guest

    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><body bgcolor=""#000000"" 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>")
     
    Janet, Mar 14, 2005
    #1
    1. Advertising

  2. Janet

    Adrienne Guest

    Gazing into my crystal ball I observed "Janet" <> writing
    in news::

    > 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><body bgcolor=""#000000"" 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
     
    Adrienne, Mar 14, 2005
    #2
    1. Advertising

  3. Janet

    Janet Guest

    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" <> wrote in message
    news:Xns96196AB3553EEarbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "Janet" <> writing
    > in news::
    >
    > > 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><body bgcolor=""#000000"" 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
     
    Janet, Mar 14, 2005
    #3
  4. Janet

    JDS Guest

    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:red"> or somesuch?

    --
    JDS | d
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
     
    JDS, Mar 14, 2005
    #4
  5. Janet

    Janet Guest

    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" <> wrote in message
    news:p...
    > 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:red"> or somesuch?
    >
    > --
    > JDS | d
    > | http://www.newtnotes.com
    > DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    >
     
    Janet, Mar 15, 2005
    #5
  6. 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><body bgcolor=""#000000"" 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><link rel=""stylesheet"" type=""text/css""
    href=""stylesheetforASPpopups.css""></head><body>")

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

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

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


    Then create stylesheet 'stylesheetforASPpopups.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
     
    Jonathan N. Little, Mar 17, 2005
    #6
    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. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    867
    Kevin Spencer
    May 17, 2005
  2. Matt Adams
    Replies:
    0
    Views:
    893
    Matt Adams
    Aug 26, 2003
  3. Janet
    Replies:
    5
    Views:
    4,736
    Jonathan N. Little
    Mar 17, 2005
  4. davetichenor
    Replies:
    1
    Views:
    847
    Eliyahu Goldin
    Oct 30, 2006
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    431
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page