Solved

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

Posted on 2011-03-02
3
435 Views
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">
    <title>Login</title>
    <link href="~/Styles/Dialog.css" rel="stylesheet" type="text/css" />

</head>
<body>

    <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">
            <Services>
                <asp:ServiceReference Path="~/WebServices/LoginService.asmx" />
                <asp:ServiceReference Path="~/WebServices/ServiceSetPrimaryGroup.asmx" />
           </Services>
        </asp:ScriptManager>
        <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 />
        </div>
    </form>
</body>
</html>

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.
{
    $('div#divLogin').dialog({
        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)
    $('#divLogin').keyup(function(e) 
    {
        if (e.keyCode == 13)
        {
            $("div.ui-dialog-buttonpane button:first").click();
        }
    });
    document.getElementById("txtUserName").focus();
}

Open in new window

0
Comment
Question by:leskelly
  • 2
3 Comments
 
LVL 13

Expert Comment

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

Author Comment

by:leskelly
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?
0
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 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".
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now