To resolve this problem, use one of the following methods.
Method 1
Make sure that the Web page that contains the <iframe> element and the Web page to which the <iframe> element points are in the same domain.
Method 2
Update the JavaScript files to avoid the error message. Use the external script files that exist in the AJAX Library package instead of the resource-based files that exist in the AJAX Extension package. To do this, follow these steps.
Step 1: Configure the Web page to use the script files instead of the resource-based files
- Download and then extract the AJAX Library from the Microsoft Download Center.
The following file is available for download from the Microsoft Download Center:
Download the Microsoft AJAX Library package now.
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
- On the Web page that contains the <iframe> element, specify a value for the ScriptPath attribute in the <ScriptManager> element. The following code looks for the scripts in a folder that is named Scripts in the application root directory.
<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptPath="~/Scripts" />
- Copy the System.Web.Extensions folder in the AJAX Library into the Scripts folder.
- Access the ASPX page to confirm that the script files are called from the Scripts folder. To do this, click Source on the View menu in Internet Explorer. Locate the following two script tags.
<script src="Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" type="text/javascript"></script>
<script src="Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjaxWebForms.js" type="text/javascript"></script>
Step 2: Modify the MicrosoftAjax.debug.js file to avoid the error message
You must use the MicrosoftAjax.debug.js file when the
debug attribute in the <compilation> element is set to True in the Web.config file. The MicrosoftAjax.debug.js file contains line breaks. To modify the MicrosoftAjax.debug.js file, follow these steps:
- Open the MicrosoftAjax.debug.js file. This file is located in the following folder:
Application Root Directory/Scripts/System.Web.Extensions/1.0.61025.0
- Locate the following two lines of code. (There may be code between these two lines.)
switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
- Paste the following code between the two lines of code that are listed in step 2b. If code exists between the two lines, replace the code.
New Code Sys.UI.DomElement.getLocation = function(element) {
if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0);
var clientRect = element.getBoundingClientRect();
if (!clientRect) {
return new Sys.UI.Point(0,0);
}
var ownerDocument = element.document.documentElement;
var offsetX = clientRect.left - 2 + ownerDocument.scrollLeft,
offsetY = clientRect.top - 2 + ownerDocument.scrollTop;
try {
var f = element.ownerDocument.parentWindow.frameElement || null;
if (f) {
var offset = 2 - (f.frameBorder || 1) * 2;
offsetX += offset;
offsetY += offset;
}
}
catch(ex) {
}
return new Sys.UI.Point(offsetX, offsetY);
}
break;
- Save the MicrosoftAjax.debug.js file.
- Open the Web.config file in the ASP.NET program, and then set the debug attribute to True in the <compilation> element.
- Save the Web page.
Step 3: Modify the MicrosoftAjax.js file to avoid the error message
The MicrosoftAjax.js file is the release version of the MicrosoftAjax.debug.js file. The MicrosoftAjax.js does not contain line breaks. To modify the MicrosoftAjax.js file, follow these steps:
- Open the MicrosoftAjax.js file in the Scripts folder.
- Locate the following two lines of code. (There may be code between these two lines.)
switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:
- Paste the following code between the two lines of code that are listed in step 3b. If code exists between the two lines, replace the code.
New CodeSys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9) return new Sys.UI.Point(0,0);
var b=a.getBoundingClientRect();
if(!b) return new Sys.UI.Point(0,0);
var c=a.document.documentElement,d=b.left-2+c.scrollLeft,e=b.top-2+c.scrollTop;
try{var g=a.ownerDocument.parentWindow.frameElement||null;
if(g){var f=2-(g.frameBorder||1)*2;
d+=f;e+=f}}catch(h){}return new Sys.UI.Point(d,e)};
break;
- Save the MicrosoftAjax.js file.
- Open the Web.config file in the ASP.NET program, and then set the debug attribute to True in the <compilation> element.
- Save the Web page.