Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net page not including Javascript file.

Reply
Thread Tools

ASP.Net page not including Javascript file.

 
 
Joseph Ferris
Guest
Posts: n/a
 
      04-21-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      04-21-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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
> (E-Mail Removed)
>


 
Reply With Quote
 
 
 
 
Joseph Ferris
Guest
Posts: n/a
 
      04-21-2005
Ken,

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

Thank you, kindly,

Joseph
(E-Mail Removed)

 
Reply With Quote
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      04-21-2005
Hey Joseph,

Glad that was it!

Ken

"Joseph Ferris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Ken,
>
> That was precisely what was going on. I removed the existing Scripts
> Virtual Directory and recreated it. Worked perfectly.
>
> Thank you, kindly,
>
> Joseph
> (E-Mail Removed)
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disadvantage of including JavaScript files within a JavaScript file? vunet Javascript 2 07-08-2008 03:18 PM
Problem with web page containing Updatepanel & Script manager while including master page Valli ASP .Net 1 10-03-2007 09:31 PM
Including ASPX page in Classic ASP page? Chris Ashley ASP .Net 5 04-12-2006 06:09 PM
Including external javascript code in a web page David D. Javascript 8 12-03-2004 04:17 PM
including a javascript file =?Utf-8?B?SnVzdGlu?= ASP .Net 3 10-18-2004 10:30 PM



Advertisments