Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 2nd, 2008, 12:48 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 - a:visited not working

I was into chapter 4 but went back to chapter 3 due to noticing some problems with my a:visited links. The reaction works differently depending on the browsers I use. I cleared caches and delete the history but it makes no difference.

Browsers:

Firefox 2.0.0.13
IE 7.05730.13
Netscape 8.0.2

StyleSheet.css

#header
{
    background-color: #C0C0C0;
    width: 844px;
    height: 33px;
}

*
{
    font-family: Arial, Helvetica, sans-serif;
}

h1
{
    font-size: 20px;
}

#pageWrapper
{
    width: 844px;
}

#mainContent
{
    width: 644px;
    float: left;
}

#sideBar
{
    background-color: #C0C0C0;
    width: 200px;
    float: left;
}

#footer
{
    background-color: #C0C0C0;
    width: 844px;
    clear: both;
}

#mainContent a
{
    color: #008000;
    text-decoration: underline;
}

#mainContent a:visited
{
    color: #FF0000;
    text-decoration: underline;
}

#mainContent a:hover
{
    color: #FFA500;
    text-decoration: underline;
}

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            color: #FF9900;
        }
    </style>
    <link href="Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="pageWrapper">
        <div id="header">Header Goes Here</div>
        <div id="menuWrapper">Menu Goes Here</div>
        <div id="mainContent">
        <h1>Hi there visitor and welcome to Planet Wrox</h1>
        <p>We are glad you#39;re <span class="style1">paying a visit</span> to <a href="http://www.PlanetWrox.com">www.PlanetWrox.com</a>, the coolest music community site on the Inernet.</p>
        <p>Feel free to have a <a href="Default.aspx">look around</a>, and there are lots of interesting <b>reviews
            and concert pictures</b> to be found here.</p>
        </div>
        <div id="sideBar">Sidebar goes here</div>
        <div id="footer">Footer goes here</div>
    </div>
    </form>
</body>
</html>

Problems:

Firefox - a:visited doesn't work not matter what I do.

IE - works only when I press cntr-F5 or open IE from my desktop and paste the link in, but it doesn't work when I hit the View in Browser icon - It ignores (a) in the second link (look around) and only recognizes the a:visited and a:hover.

Netscape - the second link always ignores (a) - it's green on the first link but always red on the second, even when I open it and paste the link in.

:(
Remember, all caches and page history has been removed.
Reply With Quote
  #2 (permalink)  
Old April 2nd, 2008, 08:48 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have found a few things out:

FireFox: The browser settings were set to remember 0 visited pages, therefore it would never show the visited links. I changed it, but now is only shows the visited links for the page it's on, no matter what I do. (This could be a cause of concern).

IE: It works fine even if it's set to remember 0 visited pages. But I have still press cntr-f5. It will not work if I right click on the default page and choose, browse with... because it always shows the link as visited even though I clear the history.

So it looks like control-F5 while having IE as my dafault browser is the only sure way to check out the effects of CSS. It's kind of sad because I prefer FireFox. Such is life.

Reply With Quote
  #3 (permalink)  
Old April 2nd, 2008, 04:16 PM
Imar's Avatar
Wrox Author
Points: 66,981, Level: 100
Points: 66,981, Level: 100 Points: 66,981, Level: 100 Points: 66,981, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,179
Thanks: 65
Thanked 1,401 Times in 1,381 Posts
Default

Hi VeganMan,

This sounds like a caching issue, although you said you removed them all. Did you also restart IE after clearing the cache?

To find out if it's caching, move the CSS from the separate CSS file into the <style> section of your page.

Usually, when Ctrl+F5 gives you want you need, the page is OK, but the server provides an older version, or the browser reuses an old one.

Personally, I wouldn't bother with Netscape....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #4 (permalink)  
Old April 2nd, 2008, 07:02 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Firefox is set to delete everything when it shuts down. It had the same effect when I first opened your sample. It had the same effect when I created new websites just to check further into it. The problem with firefox is that is will not save a history when its setting is set to remembering 0 history sites. It will not allow visited pages to be seen as visited. When I change it to remember more than 0 days, it will see the link <a href="Default.aspx">look around</a> already being visited because I am on the page. I tried it on a few other sample sites and still have the same problem. I have the most updated version of firefox. If you have the same version as me, give it a try. I know I had problems with it before when I was using Dreamweaver. But didn't know what was wrong until now.

IE only works if I use CONTROL-F5. But it's not too often one would use a:visited with a link to itself to worry about it. I will just get into the habbit of using CONTROL-F5.

Yes, the pages are shut down and I even looked under history to make sure there was nothing in there.

Thanks Imar
I should be in Chapter 5 later today

Reply With Quote
  #5 (permalink)  
Old April 3rd, 2008, 12:31 AM
Imar's Avatar
Wrox Author
Points: 66,981, Level: 100
Points: 66,981, Level: 100 Points: 66,981, Level: 100 Points: 66,981, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,179
Thanks: 65
Thanked 1,401 Times in 1,381 Posts
Default

I think that once you put a site live on a server, things will be normal again. From what I hear, this seems to be related to your development environment, and not to IE or the actual CSS used....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4 - Two Views, not working for me... bigtalk BOOK: Beginning Ruby on Rails 1 January 3rd, 2008 06:30 AM
Chapter 6: store not working Giorgio84 BOOK: Beginning Ruby on Rails 2 June 17th, 2007 11:17 PM
Chapter 1, First App, No, it's not working redthor BOOK: Beginning Ruby on Rails 2 February 1st, 2007 07:32 PM
Working Code for Chapter 4 clomby BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 1 December 26th, 2005 05:44 AM



All times are GMT -4. The time now is 05:48 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.