When I create a new ASP 4.0 WebSite in VS2010 and examine it via the IE9 Developer Tools, I only see a single JavaScript file hiding behind WebResource.axd. This is expected, but as soon as I add a ScriptManger into my WebSite, I unexpectedly get three more JavaScript files all of which are hiding behind ScriptResource.axd. I think that two of these extra JavaScript files appear to be related to Microsoft’s implementation of ASP.NET AJAX, but I have no idea what the third extra JS file is for.
Is there any way I can use the ASP 4.0 ScriptManager without feeding the three extra JavaScript files down to the client?
The script manager tag I am adding to my page is as follows:
<asp:ScriptManager ID="myScriptManager" runat="server" />
Thanks,
Shawn
Note: Even though the SO Scriptmanager remove javascript thread has a similar title, I don’t think it is related to my question since I think the mentioned thread is asking about inline JavaScript in the primary webform while I am asking about numerous external JavaScript files that hide behind an HttpHandler.
It seems possible to control what javascript files are added to the page by the ScriptManager via the property
AjaxFrameworkMode(doc).Nevertheless, depending on the use you intend to make out of it, it is possible to avoid including one in your pages.
For instance, to use PageMethods, you can make ajax requests directly to the method. A good article on Encosia deals with that.