Summary of solutions to the "sys undefined" error in Ajax

Source: Internet
Author: User
Tags connectionstrings
Error: The "sys undefined" error occurs when customizing scripts in Ajax applications.
Solution 1: Obtain the pagerequestmanager instance statement (for example, var prm = SYS. webforms. pagerequestmanager. getinstance ();
) In the function.
Solution 2: Place the JS Code after the scriptmanager control definition.
Cause Analysis: Put the scriptmanager control in the body.
JavaScript code is placed before the scriptmanager control.
Because HTML is loaded row by row.
Because var PRM = SYS. pagerequestmanager. getinstance ();
It was called before loading the JS Code of the scriptmanager control,
So there is a situation where sys is undefined.

Solution 3:

Add

<Httphandlers>
<Remove verb = "*" Path = "*. asmx"/>
<Add verb = "*" Path = "*. asmx "Validate =" false "type =" Microsoft. web. script. services. scripthandlerfactory, Microsoft. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
<Add verb = "*" Path = "* _ appservice. axd "Validate =" false "type =" system. web. script. services. scripthandlerfactory, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
<Add verb = "Get, head" Path = "scriptresource. axd "type =" system. web. handlers. scriptresourcehandler, system. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "Validate =" false "/>
</Httphandlers>

Solution 4:

If "system. Web. Extensions. dll" is referenced, it will be OK.

The Web. config configuration is as follows:

<? XML version = "1.0"?>
<! --
Note: In addition to manually editing this file, you can also use
Web management tools to configure application settings. You can use
"Website"-> "ASP. NET configuration" option.
The complete list of settings and comments is displayed in
In machine. config. Comments, this file is usually located in
\ Windows \ Microsoft. NET \ framework \ v2.x \ config
-->
<Configuration xmlns = "http://schemas.microsoft.com/.NetConfiguration/v2.0">
<Deleetask>
<Add key = "crystalimagecleaner-autostart" value = "true"/>
<Add key = "crystalimagecleaner-sleep" value = "60000"/>
<Add key = "crystalimagecleaner-Age" value = "120000"/>
</Appsettings>
<Connectionstrings>
<Add name = "dynetdata" connectionstring = "Data Source = 192.168.7.10; initial catalog = dynet; persist Security info = true; user id = dynetuser; Password = nmamtf" providername = "system. data. sqlclient "/>
</Connectionstrings>
<System. Web>
<! --
Set compilation DEBUG = "true" to insert debugging symbols
Compiled pages. However, this
Affects performance. Therefore, you must set this parameter only during development.
This value.

Visual Basic options:
Setting strict = "true" will disable all
Type conversion of data loss.
Setting explicit = "true" forces the declaration of all variables.
-->
<Authorization>
<Allow users = "? "/>
</Authorization>
<Httpruntime executiontimeout = "160" type = "codeph" text = "/codeph"/>
<Sessionstate timeout = "120"/>
<Compilation DEBUG = "true" strict = "false" Explicit = "true">
<Assemblies>
<Add Assembly = "system. Design, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Add Assembly = "system. Windows. Forms, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Data. oracleclient, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Management, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Add Assembly = "crystaldecisions. Web, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. Shared, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. reportsource, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. Enterprise. Framework, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. Enterprise. desktop. Report, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. crystalreports. Engine, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. Enterprise. infostore, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "crystaldecisions. reportappserver. clientdoc, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304"/>
<Add Assembly = "system. Web. Extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35"/>
<Add Assembly = "system, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Web, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Add Assembly = "system. configuration, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Add Assembly = "system. XML, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Drawing, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Add Assembly = "system. Data, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089"/>
<Add Assembly = "system. Drawing. Design, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/> </assemblies>
<Buildproviders>
<Add extension = ". rdlc" type = "Microsoft. Reporting. rdlbuildprovider, Microsoft. reportviewer. Common, version = 8.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
</Buildproviders>
</Compilation>
<Pages>
<Namespaces>
<Clear/>
<Add namespace = "system"/>
<Add namespace = "system. Collections"/>
<Add namespace = "system. Collections. Specialized"/>
<Add namespace = "system. Configuration"/>
<Add namespace = "system. Text"/>
<Add namespace = "system. Text. regularexpressions"/>
<Add namespace = "system. Web"/>
<Add namespace = "system. Web. Caching"/>
<Add namespace = "system. Web. sessionstate"/>
<Add namespace = "system. Web. Security"/>
<Add namespace = "system. Web. Profile"/>
<Add namespace = "system. Web. UI"/>
<Add namespace = "system. Web. UI. webcontrols"/>
<Add namespace = "system. Web. UI. webcontrols. webparts"/>
<Add namespace = "system. Web. UI. htmlcontrols"/>
</Namespaces>
</Pages>
<! --
In the <authentication> section, you can configure
Security Authentication mode,
To identify the user.
-->
<Authentication mode = "NONE"/>
<! --
If an unprocessed error occurs during request execution,
You can configure the corresponding processing steps in the <mermerrors> section. Specifically,
This section allows developers to configure
HTML error page to be displayed
To replace the error stack trace.

<Customerrors mode = "remoteonly" defaultredirect = "genericerrorpage.htm">
<Error statuscode = "403" Redirect = "noaccess.htm"/>
<Error statuscode = "404" Redirect = "filenotfound.htm"/>
</Customerrors>
-->
<Httphandlers>
<Add Path = "crystalimagehandler. aspx "verb =" get "type =" crystaldecisions. web. crystalimagehandler, crystaldecisions. web, version = 10.2.3600.0, culture = neutral, publickeytoken = 692fbea5521e1304 "/>
<Add Path = "Reserved. reportviewerwebcontrol. axd "verb =" * "type =" Microsoft. reporting. webforms. httphandler, Microsoft. reportviewer. webforms, version = 8.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a "Validate =" false "/>
<Remove verb = "*" Path = "*. asmx"/>
<Add verb = "*" Path = "*. asmx "Validate =" false "type =" Microsoft. web. script. services. scripthandlerfactory, Microsoft. web. extensions, version = 1.0.61025.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "/>
<Add verb = "get" Path = "scriptresource. axd" type = "Microsoft. Web. Handlers. scriptresourcehandler" Validate = "false"/>
</Httphandlers>
</System. Web>
</Configuration>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.