Scripting errors in asp.net Ajax: sys undefined workaround

Source: Internet
Author: User
Tags iis net resource version access
Ajax|asp.net| Error | script | solve

Wish you all a good year ahead! The last time we worked day and night, I finally launched a new version of the project as planned. Finally, I have time to write something today.

Some time ago company colleagues introduced the ASP.net Ajax (beta1) version of the project. With the use of, when viewing the Web page, the ' Sys ' undefined error is occasionally reported. According to the online method to Web.confg did a turn operation, a little effect is not. Think about it, web.config with Ben did not change, why suddenly put the problem on people's head? After a fumble, suddenly found that the original is the trouble of identity verification. In a Web site that is configured for authentication, access to Ajax script resources is denied to access to the login page, and the request for Ajax on the page cannot be completed because no script file is requested, and the report SYS does not define an error!

The details are as follows:

asp.net Ajax scripts are encapsulated into VxD files (a ihttphandle implementation, asp.net itself is implemented in this way), we can see a script reference similar to the following on the page:

Script references for ASP.net

<script src= "/adcadminportal/webresource.axd?d=oahqughlcngt9qbb6bqloq2&t=632980334575156250" type= "text/ JavaScript "></script>

   asp.net Ajax script references
<script src=/adcadminportal/scriptresource.axd?d= Yvzprqrdbxpfjwzq-sd6d59ftbtz2nfeqmlt1bp5av-9skgcaxbfqf0hvegduxp2f6u7uus1yt2gh7bsfiokynnxt56b5pflxky3ifkzufl-pfkulaheygzh4 c-kk2t3r8gdxvyecnczmt0xrtk7tb9ydna4lcyyoh_wttsxiho1&t=632992694620822500 "type=" Text/javascript "></ Script>
<script src= "/adcadminportal/scriptresource.axd?d= Yvzprqrdbxpfjwzq-sd6d59ftbtz2nfeqmlt1bp5av-9skgcaxbfqf0hvegduxp2f6u7uus1yt2gh7bsfiokynnxt56b5pflxky3ifkzufl-pfkulaheygzh4 c-kk2t3d4nw9sgeqexomb5pilf4acll48eld5fncjh_modijtm1&t=632992694620822500 "type=" Text/javascript "></ Script>

When authentication is required, access to any file on the Web site is denied until you log on. And the general site has a part of the page is not required ID verification, such as: Home, News page, login page, and so on. Therefore, the SYS undefined error on the site appears. This error is completely resolved after the Axd file is defined as no validation.
   
<location path= "ScriptResource.axd" >
<system.web>
<authorization>
<allow users= "*"/>
</authorization>
</system.web>
</location>

  
It is also noted that all files in the Web Servier with VS 2005 are parsed by ASP.net, and that this is the cause of the picture being displayed on the page that is not logged on.

I think 90% of asp.net Ajax's sys undefined error is caused by this. After the above configuration, the problem can be lifted. In one subsequent release to IIS, a script error still occurred, and the final check found that the script resource in Ajax was still unresolved. After checking that the configuration is correct in IIS, delete the virtual directory and the problem disappears after the rebuild.

Tips:

asp.net ajax scripting errors are largely due to the inability of the script resource file VxD to parse. If there is a script error, first look at the page in IE HTML source code, the <scipt> script references in the SRC value all copy down, directly into IE's address bar for access, if you can resolve to script files (prompted to download), then the resolution is successful, if you can not download, Indicates that a VxD cannot be resolved because it is usually caused by an identity card verification. If only one year of white black word "Cannot find Web page" IIS error page, it is not related to ASP.net, it is possible that IIS does not resolve the VxD file, you can check the IIS default extension resolution configuration has been changed. If no changes have been made, the virtual directory is rebuilt. Otherwise, re-register the asp.net in IIS.
Http://www.cnblogs.com/cwbboy/archive/2006/12/26/604183.html



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.