CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    63

    styles disappearing when back button clicked

    For some odd reason, when I click the back button on my browser, the CSS for my WebApp page disappear. The WebApp is being programmed in ASP.NET and C# codebehind. I have a CSS file that I reference in my aspx pages. When I visit page A, the styles are there. When I click a button to go to page B, the styles are on page B as well. Then, from page B, I click the browser's back button, returning to page A, and the styles don't show up on page A.

    In particular, I have a table on page A whose opening tag looks like this:

    <table id="InvoiceTable" class="CISTable" runat="server">

    And I'm referencing the CSS file like this:

    <asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
    <title>CIS - Period Summary</title>
    <link href="CISStyleSheet.css" type="text/css" rel="Stylesheet" />
    </asp:Content>

    And the CSS file looks like this:

    Code:
    .CISTable
    {
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
    width:100%;
    border-collapse:collapse;
    }
    .CISTable td, .CISTable th 
    {
    font-size:1em;
    border:1px solid #00009C;
    padding:3px 7px 2px 7px;
    }
    .CISTable th 
    {
    font-size:1.1em;
    text-align:left;
    padding-top:5px;
    padding-bottom:4px;
    background-color:#000000;
    color:#ffffff;
    }
    .CISTable tr.alt td 
    {
    color:#000000;
    background-color:#D4ED91;
    }
    .CISTable tr.total td
    {
    color: #000000;
    background-color:#CFFFFF;
    }
    #information
    {
        font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
        font-style:italic;
    }
    Can anyone suggest what might be happening?

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: styles disappearing when back button clicked

    Try a different browser to rule out the possibility that your page is cached and the styles are never actually being loaded properly (now) from the server, only from cache
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured