Use AJAX offline

84 Views Asked by At

I deployed an app to a local server without access to the internet and I have all my resources local and referenced. However, when it's running, it auto-generates the following code

<script src="http://ajax.aspnetcdn.com/ajax/4.6/1/webForms.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/4.5.1/1/MicrosoftAjax.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/4.5.1/1/MicrosoftAjaxWebForms.js" type="text/javascript"></script>

I have said files locally but I don't know how to use them instead of the links.

1

There are 1 best solutions below

0
Tavojavi On
  1. Copy the files locally:

Download the script files (webForms.js, MicrosoftAjax.js, MicrosoftAjaxWebForms.js) from the ASP.NET CDN Place them in a suitable folder within your application's directory structure, such as a "Scripts" or "Resources" folder.

  1. Update the script references: In your ASPX pages: Replace the CDN links with paths pointing to the local files. For example: HTML

Ensure the paths are correct relative to the location of your ASPX pages.

  1. Check for script manager configuration: If you're using a ScriptManager control in your pages, make sure its EnableCdn property is set to false to prevent automatic CDN references:

<asp:ScriptManager EnableCdn="false" runat="server">