ASP.Net page not including Javascript file.

Discussion in 'ASP .Net' started by Joseph Ferris, Apr 21, 2005.

  1. Hello everyone.

    I recently reloaded my system, and I am now having problems getting one
    of my client's sites running. I pulled a copy of the development tree
    for the project out of subVersion (the source control software we are
    using) and placed it into the IIS Web Root. After building and
    attempting to run the Solution, I am having problems with included
    Javascript files.

    How it is set up is that we have some .js files that have common
    functions that are reused by the pages. So, we include the .js file in
    each page, and the page calls the function(s) on an as-needed basis.
    This has previously worked on my machine, and works on the other
    developers' machines. When I run it, I get a "Microsoft JScript
    runtime error: Object Expected.". I have tried shutting down the
    Solution and clearing the VSWebCache, thinking it might be a fragment
    from the previous client site that I was using (such as it was looking
    for a file that didn't exist in the users site, and it is looking at a
    cache somewhere). But, to no avail... I am still stuck.

    Here is a fragment of the aspx page in question:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>Client Login</title>
    <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
    <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    <link href="styles/default.css" type="text/css" rel="stylesheet">
    <!-- javascript code -->
    <script language="javascript" src="Scripts/uiEffects.js"></script>
    <script language="javascript" type="text/javascript">

    function loadPage(){
    preLoadImages();
    document.getElementById("txtUserId").focus();
    }

    </script>
    </HEAD>

    In this case, the uiEffects.js file does not get loaded, or if it does,
    the preLoadImages() function in the loapPageFunction() is not being
    found, as this is where the message is firing. If I look at the
    Running Processes, I can see that uiEffects.js is not listed, as it
    usually would be if it was loaded. There are no other error messages
    until I hit the call for a function that is within the included file.

    Any help would be greatly appreciated, as I am dead in the water until
    I can get this resolved.

    Thank you in advance,

    Joseph
    Joseph Ferris, Apr 21, 2005
    #1
    1. Advertising

  2. Hi Joseph,

    Is it possible that the Scripts directory was previously created as a
    virtual directory in IIS and needs to be set that way again?

    What happens if you put the full URL such as

    src="http://myserver/Scripts/uiEffects.js">

    Just trying a couple of ideas to get you going again...

    Ken
    Microsoft MVP [ASP.NET]
    Toronto

    "Joseph Ferris" <> wrote in message
    news:...
    > Hello everyone.
    >
    > I recently reloaded my system, and I am now having problems getting one
    > of my client's sites running. I pulled a copy of the development tree
    > for the project out of subVersion (the source control software we are
    > using) and placed it into the IIS Web Root. After building and
    > attempting to run the Solution, I am having problems with included
    > Javascript files.
    >
    > How it is set up is that we have some .js files that have common
    > functions that are reused by the pages. So, we include the .js file in
    > each page, and the page calls the function(s) on an as-needed basis.
    > This has previously worked on my machine, and works on the other
    > developers' machines. When I run it, I get a "Microsoft JScript
    > runtime error: Object Expected.". I have tried shutting down the
    > Solution and clearing the VSWebCache, thinking it might be a fragment
    > from the previous client site that I was using (such as it was looking
    > for a file that didn't exist in the users site, and it is looking at a
    > cache somewhere). But, to no avail... I am still stuck.
    >
    > Here is a fragment of the aspx page in question:
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > <HTML>
    > <HEAD>
    > <title>Client Login</title>
    > <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
    > <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > name="vs_targetSchema">
    > <link href="styles/default.css" type="text/css" rel="stylesheet">
    > <!-- javascript code -->
    > <script language="javascript" src="Scripts/uiEffects.js"></script>
    > <script language="javascript" type="text/javascript">
    >
    > function loadPage(){
    > preLoadImages();
    > document.getElementById("txtUserId").focus();
    > }
    >
    > </script>
    > </HEAD>
    >
    > In this case, the uiEffects.js file does not get loaded, or if it does,
    > the preLoadImages() function in the loapPageFunction() is not being
    > found, as this is where the message is firing. If I look at the
    > Running Processes, I can see that uiEffects.js is not listed, as it
    > usually would be if it was loaded. There are no other error messages
    > until I hit the call for a function that is within the included file.
    >
    > Any help would be greatly appreciated, as I am dead in the water until
    > I can get this resolved.
    >
    > Thank you in advance,
    >
    > Joseph
    >
    >
    Ken Cox [Microsoft MVP], Apr 21, 2005
    #2
    1. Advertising

  3. Ken,

    That was precisely what was going on. I removed the existing Scripts
    Virtual Directory and recreated it. Worked perfectly.

    Thank you, kindly,

    Joseph
    Joseph Ferris, Apr 21, 2005
    #3
  4. Hey Joseph,

    Glad that was it!

    Ken

    "Joseph Ferris" <> wrote in message
    news:...
    > Ken,
    >
    > That was precisely what was going on. I removed the existing Scripts
    > Virtual Directory and recreated it. Worked perfectly.
    >
    > Thank you, kindly,
    >
    > Joseph
    >
    >
    Ken Cox [Microsoft MVP], Apr 21, 2005
    #4
    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. Chris  Ashley

    Including ASPX page in Classic ASP page?

    Chris Ashley, Apr 12, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    1,823
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2006
  2. Valli
    Replies:
    1
    Views:
    1,112
    Mike Placentra II
    Oct 3, 2007
  3. David D.
    Replies:
    8
    Views:
    148
    Grant Wagner
    Dec 3, 2004
  4. Replies:
    2
    Views:
    125
    Henry
    Sep 26, 2007
  5. vunet
    Replies:
    2
    Views:
    154
    Laser Lips
    Jul 8, 2008
Loading...

Share This Page