?
Solved

visual studio uses old version of javascript file

Posted on 2010-09-06
10
Medium Priority
?
988 Views
Last Modified: 2012-05-10
When my code hits my javascript file, it uses an old version (before I made recent changes). The page in debugger is titled: WebResource.axd?d=...[dynamic][read only].

It is not the current .js file I have saved with my application.

How do I fx this?
0
Comment
Question by:XTO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 450 total points
ID: 33612943
Check this : http://stackoverflow.com/questions/206783/when-does-browser-automatically-clear-javascript-cache

You need to add a virtual random and useless parameter at the end of the source name.
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 33614823
add a dummy query string with a dummy value to the URL of the JS file.
0
 
LVL 14

Assisted Solution

by:Dhanasekaran Sengodan
Dhanasekaran Sengodan earned 450 total points
ID: 33615733
Here is a little trick I like to use if I make a big change to a javascript file that I know will cause problems for people who have it cached:

Whenever I include a script in a page, I use the following format:

<script type="text/javascript" src="myscript.js?ver=1"></script>

Now, when the user views this page, they cache 'myscript.js?ver=1'. Whenever I want to force the user to reload a new and improved javascript file, I change the url to 'myscript.js?ver=2'. The browser doesn't use the cache, because it can't find the file, and it caches 'myscript.js?ver=2' for the next time they visit the page.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:XTO
ID: 33620501
In the OnPreRender event of my class I had the following code:

string scriptLocation =
                    Page.ClientScript.GetWebResourceUrl(this.GetType(), "querySections.querysection.js");

I changed querysection.js to querysection2.js . That didn't work.

I tried, querysection2.js?ver=123. That didn't work.

I hard coded into my .aspx page:
<script type="text/javascript" src="/queryAbstracts/querySection.js?ver=1"></script>

That didn't work either.
The browser is still reverting to the old version.


0
 
LVL 7

Expert Comment

by:Inteqam
ID: 33622726
something is wrong. this should work.
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 33622731
are you caching the page? the full page?
0
 

Author Comment

by:XTO
ID: 33622755
I think I might have figured out what the problem is. My main project's bin directory has references to the projects, one of which contains the javascript file. I'm guessing that the DLL referenced in the BIN directory contains the old javascript file. Is that possible?
I may just need to update the DLL references in the BIN directory. I'll play around with that and see how that works.
0
 
LVL 7

Accepted Solution

by:
Inteqam earned 600 total points
ID: 33622792
very possible.

but building the solution should build new DLLs

try to clear the solution out and rebuild it
0
 

Author Comment

by:XTO
ID: 33629499
I was copying the DLL out of the project and copying it to the BIN folder of the main project. Rebuilding the page, I guess, was building the DLL in the original project and not the one copied to the BIN folder.
0
 

Author Closing Comment

by:XTO
ID: 33629539
The above answers did not pertain to my situation, but they did increase my knowledge so I feel that they deserve some points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question