P
Peter
I am trying to add the script manager to a web page ASP.NET 2.0
I am getting the following error when I try to run the website
Microsoft JScript runtime error: 'Sys' is undefined
Sys.WebForms.PageRequestManager._initialize('ScriptManager1',
document.getElementById('form1'));
How can I fix this problem?
Here's the web page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
</div>
</form>
</body>
</html>
Here's the web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="microsoft.web.preview"
type="Microsoft.Web.Preview.Configuration.PreviewSectionGroup,
Microsoft.Web.Preview">
<section name="search"
type="Microsoft.Web.Preview.Configuration.SearchSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="searchSiteMap"
type="Microsoft.Web.Preview.Configuration.SearchSiteMapSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="diagnostics"
type="Microsoft.Web.Preview.Configuration.DiagnosticsSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
</sectionGroup>
</configSections>
<microsoft.web.preview>
<!--
<search enabled="true">
<providers>
<add name="WindowsLiveSearchProvider"
type="Microsoft.Web.Preview.Search.WindowsLiveSearchProvider,
Microsoft.Web.Preview"
appID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
siteDomainName="xxxxxx.xxxx.xxx" />
</providers>
</search>
-->
<!--
<searchSiteMap enabled="true">
<providers>
<add name="Navigation"
type="Microsoft.Web.Preview.Search.AspNetSiteMapSearchSiteMapProvider,
Microsoft.Web.Preview"/>
</providers>
</searchSiteMap>
-->
<!--
<diagnostics enabled="true"/>
-->
</microsoft.web.preview>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="Microsoft.Web.Preview, Version=1.3.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
<buildProviders>
<add extension="*.asbx"
type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
</buildProviders>
</compilation>
<pages>
<controls>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.Search"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.Diagnostics"
assembly="Microsoft.Web.Preview"/>
</controls>
</pages>
<httpHandlers>
<add verb="GET,HEAD,POST" path="*.asbx"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET" path="SearchSiteMaps.axd"
type="Microsoft.Web.Preview.Search.SearchSiteMapHandler" validate="true"/>
<add verb="*" path="Diagnostics.axd"
type="Microsoft.Web.Preview.Diagnostics.DiagnosticsHandler"
validate="true"/>
</httpHandlers>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089">
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
compilerOptions="/optioninfer+" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under
Internet
Information Services 7.0. It is not necessary for previous version of
IIS.
-->
<system.webServer>
<handlers>
<add name="ASBXHandler" verb="GET,HEAD,POST" path="*.asbx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="SearchSiteMaps" preCondition="integratedMode" verb="GET"
path="SearchSiteMaps.axd"
type="Microsoft.Web.Preview.Search.SearchSiteMapHandler"/>
<add name="Diagnostics" preCondition="integratedMode" verb="*"
path="Diagnostics.axd"
type="Microsoft.Web.Preview.Diagnostics.DiagnosticsHandler"/>
</handlers>
</system.webServer>
</configuration>
I am getting the following error when I try to run the website
Microsoft JScript runtime error: 'Sys' is undefined
Sys.WebForms.PageRequestManager._initialize('ScriptManager1',
document.getElementById('form1'));
How can I fix this problem?
Here's the web page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
</div>
</form>
</body>
</html>
Here's the web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="microsoft.web.preview"
type="Microsoft.Web.Preview.Configuration.PreviewSectionGroup,
Microsoft.Web.Preview">
<section name="search"
type="Microsoft.Web.Preview.Configuration.SearchSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="searchSiteMap"
type="Microsoft.Web.Preview.Configuration.SearchSiteMapSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
<section name="diagnostics"
type="Microsoft.Web.Preview.Configuration.DiagnosticsSection,
Microsoft.Web.Preview" requirePermission="false"
allowDefinition="MachineToApplication"/>
</sectionGroup>
</configSections>
<microsoft.web.preview>
<!--
<search enabled="true">
<providers>
<add name="WindowsLiveSearchProvider"
type="Microsoft.Web.Preview.Search.WindowsLiveSearchProvider,
Microsoft.Web.Preview"
appID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
siteDomainName="xxxxxx.xxxx.xxx" />
</providers>
</search>
-->
<!--
<searchSiteMap enabled="true">
<providers>
<add name="Navigation"
type="Microsoft.Web.Preview.Search.AspNetSiteMapSearchSiteMapProvider,
Microsoft.Web.Preview"/>
</providers>
</searchSiteMap>
-->
<!--
<diagnostics enabled="true"/>
-->
</microsoft.web.preview>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="Microsoft.Web.Preview, Version=1.3.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
<buildProviders>
<add extension="*.asbx"
type="Microsoft.Web.Preview.Services.BridgeBuildProvider"/>
</buildProviders>
</compilation>
<pages>
<controls>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.Search"
assembly="Microsoft.Web.Preview"/>
<add tagPrefix="asp" namespace="Microsoft.Web.Preview.Diagnostics"
assembly="Microsoft.Web.Preview"/>
</controls>
</pages>
<httpHandlers>
<add verb="GET,HEAD,POST" path="*.asbx"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET" path="SearchSiteMaps.axd"
type="Microsoft.Web.Preview.Search.SearchSiteMapHandler" validate="true"/>
<add verb="*" path="Diagnostics.axd"
type="Microsoft.Web.Preview.Diagnostics.DiagnosticsHandler"
validate="true"/>
</httpHandlers>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089">
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
compilerOptions="/optioninfer+" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under
Internet
Information Services 7.0. It is not necessary for previous version of
IIS.
-->
<system.webServer>
<handlers>
<add name="ASBXHandler" verb="GET,HEAD,POST" path="*.asbx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="SearchSiteMaps" preCondition="integratedMode" verb="GET"
path="SearchSiteMaps.axd"
type="Microsoft.Web.Preview.Search.SearchSiteMapHandler"/>
<add name="Diagnostics" preCondition="integratedMode" verb="*"
path="Diagnostics.axd"
type="Microsoft.Web.Preview.Diagnostics.DiagnosticsHandler"/>
</handlers>
</system.webServer>
</configuration>