Changes to .js file in Visual Studio 2008 do not take affect even after saving and building

Posted on 2011-03-02
Medium Priority
Last Modified: 2013-11-26
I'm in the process of developing a .NET application in Visual Studio 2008 using VB.net, JavaScript and jQuery.  The problem is occurring on my development machine which is running Windows 7.  The first page to open is a log in page, Login.aspx, that contains references to three external JavaScript files including one called Login.js.  When I make changes to this file they don't always take affect even if I manually save the file and rebuild the solution.  This had been occurring periodically but today no matter how often I go through the process the change does not take affect.  In this case the change is commenting out one line that changes the height of a jQuery dialog.  I've attached the HTML and JavaScript.  The line that was changed is 53.

When I set a break point  where the dialog is created and run the VS debugger the line shows up as being commented out but after that line is passed over I can see that the height of the dialog has changed from "auto" to 850 by checking the height option in the watch list.

Yesterday I had made a change to correct an error and ran the app with out debugging.  The error still occurred and when I ran an external debugger it showed the file as being unchanged even though in Visual Studio I could see the change.

Any suggestions would be greatly appreciated.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" %>
<!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 id="Head1" runat="server">
    <link href="~/Styles/Dialog.css" rel="stylesheet" type="text/css" />


    <script src="<%=ResolveUrl("~/js/jquery/jquery-1.4.2.js")%>" type="text/javascript"></script>
    <script src="<%=ResolveUrl("~/js/jquery/jQueryUI.js")%>" type="text/javascript"></script>
 <%--   <script src="<%=ResolveUrl("~/js/jquery/jquery-1.4.2-vsdoc.js")%>" type="text/javascript"></script>--%>
    <script src="<%=ResolveUrl("~/js/Login.js")%>" type="text/javascript"></script>

    <form id="frmLogin" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
                <asp:ServiceReference Path="~/WebServices/LoginService.asmx" />
                <asp:ServiceReference Path="~/WebServices/ServiceSetPrimaryGroup.asmx" />
        <div id="divLogin" title ="Login">
            <div id="lblLoginMessage" class="Message" visible="false"></div>
            <span style="display:inline;">User Name:</span>
            <input type="text" id="txtUserName" style="width:150px;" onchange="UserNameEntered(txtUserName.value, lblEmployeeNumber, txtEmployeeNumber)"/>
            <br />
            <span style="display:inline;">Pass Word:&nbsp;</span>
            <input type="password" id="txtPassWord" style="width:150px;" />
            <br />
            <span id="lblEmployeeNumber" style="width:118px; display:inline; visibility:hidden">Employee #:</span>
            <input type="password" id="txtEmployeeNumber" style="width:150px; visibility:hidden" />
            <br />
            <span id="lblGroup" style="display:inline; visibility:hidden">Group:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</span> 
            <select id="ddlGroup" style="width:158px; visibility:hidden"></select>
            <br />

function OpenLoginDialog()
// The Page_Load procedure of Login.aspx has registered a Startup Script for the page that calls this function when the Login.aspx page is opened.
// This function creates a Jquery dialog box out of divLogin which contains the fields neccesary for loging into Client Track.
        height: "auto",
        buttons: { "Login": function() { Login(txtUserName.value, txtPassWord.value, txtEmployeeNumber, ddlGroup) }, "Cancel": function() { window.close(); } }

    $("a.ui-dialog-titlebar-close").css("visibility", "hidden");
//    $('div#divLogin').dialog("option", "height", 850)
        if (e.keyCode == 13)
            $("div.ui-dialog-buttonpane button:first").click();

Open in new window

Question by:leskelly
  • 2
LVL 13

Expert Comment

ID: 35018634
Clear the browser cache. Go to Tools > Internet Options > Browsing History > click Delete button.

Author Comment

ID: 35018694
That did the trick thanks.  Is there no way around this or do I have to do this every time I make a change?
LVL 13

Accepted Solution

devlab2012 earned 2000 total points
ID: 35024302
Set the http meta tags - PRAGMA, CACHE-CONTROL to "NO-CACHE".

Also, in IE, go to Tools > Internet Options > Browsing History > Setting > under "Check the newer versions of stored pages" select "Everytime I visit the page".

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

599 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