By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

script tag generating error

P: n/a
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>
Mar 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.

Mar 24 '06 #2

P: n/a
sai

zino wrote:
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>


Apr 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.