Solved

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

Posted on 2011-03-02
3
434 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

706 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

19 Experts available now in Live!

Get 1:1 Help Now