script tag generating error

G

Guest

on windows XP and visual studio 2005, I cannot load a javascript or a style
sheet file.
when I try to run the aspx page I get a client side runtime error stating:

"
A Runtime error has occurred
Do you wish to debug?

Line 2:
Error: Syntax error

Yes No
"

when I click Yes/No, the page continue loading but I cannot fire any client
function
from it, due to file loading failure, and, no style is applied to the page.

I know for sure that there's nothing wrong with the syntax in the javascript
file.
Plus, the file is in the same folder as the aspx page.

I tried it as:
<script type="text/javascript" src="Logon_script.js"></script>
<script language="javascript" src="Logon_script.js"></script>
and move the declaration to the top, header , body, end of document and
still not working.


I noticed that, when the <authentication ... > in web config file is set to
"Forms"
the error is generated, but when I set the authentication to "Windows"
everything works fine.

when I publish the page on our web server or on different pc, everything
works ok.
It generate this error only on my PC.
I tried to reinstall internet explorer but on winXP I don't have the option
to repair/uninstall IE.
I contacted Microsoft and they couldn't figure out the reason why.
I beleive I'm going to uninstall IIS as my last option, unless somebody can
refer me to a solution.

thanks for help

my aspx page:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Logon.aspx.vb"
Inherits="Logon" %>
<!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 runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="Logon_script.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div onclick="myfunction();">Logon page </div>
</form>
</body>
</html>
 
S

Steven Cheng[MSFT]

Hi Zino,

Welcome to the MSDN newsgroup.

AS for the problem ASP.NET application, are you developing it in VS2005
through file system project? if so, this is caused by the .NET 2.0's test
webserver. When we running ASP.NET application in test server, all the
requests (no matter for ASP.NET dynamic resources or static files like
script , image files) are processed by ASP.NET runtime. Thus, if we
configure the application to use forms authentication, those script or
images files will also be protected, this could be the cause in your
scenario.

and for deployment environment(in IIS), this won't be the problem since IIS
will directly handle those static files' requests.


Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may

learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

sai

zino said:
on windows XP and visual studio 2005, I cannot load a javascript or a style
sheet file.
when I try to run the aspx page I get a client side runtime error stating:

"
A Runtime error has occurred
Do you wish to debug?

Line 2:
Error: Syntax error

Yes No
"

when I click Yes/No, the page continue loading but I cannot fire any client
function
from it, due to file loading failure, and, no style is applied to the page.

I know for sure that there's nothing wrong with the syntax in the javascript
file.
Plus, the file is in the same folder as the aspx page.

I tried it as:
<script type="text/javascript" src="Logon_script.js"></script>
<script language="javascript" src="Logon_script.js"></script>
and move the declaration to the top, header , body, end of document and
still not working.


I noticed that, when the <authentication ... > in web config file is set to
"Forms"
the error is generated, but when I set the authentication to "Windows"
everything works fine.

when I publish the page on our web server or on different pc, everything
works ok.
It generate this error only on my PC.
I tried to reinstall internet explorer but on winXP I don't have the option
to repair/uninstall IE.
I contacted Microsoft and they couldn't figure out the reason why.
I beleive I'm going to uninstall IIS as my last option, unless somebody can
refer me to a solution.

thanks for help

my aspx page:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Logon.aspx.vb"
Inherits="Logon" %>
<!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 runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="Logon_script.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div onclick="myfunction();">Logon page </div>
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top