Re: IE does not reload css or js file...

Discussion in 'ASP .Net' started by fd123456@hotmail.com, May 5, 2008.

  1. Guest

    I believe his problem is not on his browser's side but on his server's
    side. IIS will cache the css stylesheet and will not always detect
    when it's changed (i.e. if the file is programmatically modified
    instead of copied/deleted/created).

    To disable CSS caching (and most of the caching mechanisms, be
    warned...), on the server, create the following registry key :

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters
    \UriEnableCache

    ...and set it to 0 (zero).

    This works on IIS 7, don't know about other versions but it's worth a
    try.

    Don't know if it will help with the js problem, though.

    Warning : always make a backup of the registry before editing, be
    extra careful if it's a production server, etc, you know the drill.

    HTH,

    Michel




    On 3 mai, 19:12, "Matthew Wells" <> wrote:
    > Hello,
    >
    > I'm working on an ASP.net 2.0 web project using VS 2005.  I'm on my laptop
    > running IIS on WinXP SP2 with all the latest updates.  The Default web site
    > is set to run on .net 2.0   My project uses a master page.
    >
    > I have two separate issues that I think are related.
    >
    > First, I can't figure out why changes to my CSS don't load when I start the
    > project.  The css is in the master page.  The CSS loads, but only the last
    > version I hit F5 for.  I always have to hit F5 to see the changes.  I set
    > the IE option to Check for newer versions of stored pages every time I visit
    > the webpage.  Yes I closed all instances of IE and even rebooted for good
    > measure.  No luck.
    >
    > Second, I can't get javascript to work when it's being called using the src
    > attribute.  I use
    >
    > <script type="text/javascript" src="test.js" ></script>
    >
    > test.js is in the same folder as test.aspx, which calls it.  I stripped
    > everything out of the files - even the code-behind file.  All that's in the
    > .js file is an alert function.  The only thing on the web form is a button
    > that calls the function using OnClientClick.  It works if I put the function
    > in the web form so I know javascript works.  I had a brief moment of success
    > when it worked - I thought - but it was having the same problem as the CSS -
    > It would not show the latest changes without hitting F5.  I would make the
    > message "aaaaa" and start the project, hit F5 and see "aaaaa".  I'd stop the
    > project, change the message to "bbbbb", start the project and still see
    > "aaaaa" until I hit F5 and see "bbbbb".
    >
    > This is why I think the CSS and javascript problems are related.
    >
    > Does anyone know why this is happening?
    >
    > Thanks.
    >
    > Matthew Wells
    >
    , May 5, 2008
    #1
    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. Mike
    Replies:
    5
    Views:
    544
    jasonwitty
    Aug 25, 2006
  2. Joshua Beall
    Replies:
    26
    Views:
    220,397
    AndreiKaa
    Jun 29, 2007
  3. gen_tricomi
    Replies:
    2
    Views:
    737
    gen_tricomi
    May 23, 2006
  4. David
    Replies:
    2
    Views:
    795
    bruce barker
    May 5, 2008
  5. Stefan Mueller
    Replies:
    4
    Views:
    294
    Stefan Mueller
    Nov 5, 2005
Loading...

Share This Page