When Ajax is used in Asp.net, the error "'sys 'undefined" is returned.

Source: Internet
Author: User

Use aspx.net todayAjaxThe modalpopup control in is used to refresh some pages. However, an error message is displayed when you debug the program"Sys"UndefinedIn Baidu Google, you need to add a configuration on the Web. config page. The Code is as follows:

<Location Path ="Scriptresource. axd">
<System. Web>
<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>
</System. Web>
</Location>

After the increase, the error is eliminated. Haha!

By the way, you can add additional knowledge and extend it to the WebService method.

WebService MethodUndefinedSolution:

Add the following code to Web. config:

<Httphandlers>
<Remove verb = "*" Path = "*. asmx"/>
<Add verb = "*" Path = "*. asmx" Validate = "false" type = "system. Web. Script. Services. scripthandlerfactory"/>
<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>

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.