AJAX :: Using CompositeScript To Combine ScriptResource.axd Files?
Jan 10, 2011
I'm having a problem trying to combine the ScriptResource.axd files automatically generated by Ajax using ScriptManager's CompositeScript property....on some pages there's 15 of these files, so I'd like to reduce that number to reduce the HTTP requests. I tried following the post here - [URL] - but am getting errors when trying to do what it instructs, such as:
Microsoft JScript runtime error: 'Sys' is undefined Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load. Below is the code I am using for the ScriptManager. These errors go away if I do not use CompositeScript. Has anyone else attempted to combine these files? Am I doing something wrong in this code?
I know how to fix this using a plane old asp:scriptmanager (use script manager proxies). But how do I fix it using a ToolkitScriptManager?
UpdateI've tried doing this with the script combiner included in the sample application. I think it's right, but I've been wrong plenty of times before... No luck though.Another update So, I thought that maybe if I included multiple CompositeScript blocks within the single ToolkitScriptManager it might create them all as separate files. Nope. Still get the same error. No one has any ideas? When I Google "toolkitscriptmanager cannot be longer than 1024 characters" this StackOverflow question is the number 1 result...
I lied! The commandline fails if the two source files have different bitrates (does samplerate matter?). Also, the source code below succeeds when the two sources are the same bitrate. So, this looks like a bitrate challenge now.
result.mp3 (from the commandline, below) is playable in WMP11. The ASP.NET code below serves a file which plays fine in WMP11. But, when I uncomment those two lines, WMP11 won't play the file. Something about the code that merges the two MP3 files isn't to the satisfaction of WMP11. How can I change the ASP.NET code to merge the two MP3s in the HTTP response with the success that the 'copy' commandline gives me?
My website is looking in the wrong place for the scriptresource.axd and webresource.axd. How do I point it at the correct subfolder? Or how do I set it so that scriptresource.axd and webresource.axd are stored in the root of the website?All the ajax is done within subfolders. The web.config is at the root of the website.
I have setup my website (ASP.NET 3.5) with AJAX, running with no problems at all.
When I test my website locally and on my main top level domain, there are no problems.
When I'm on a subdomain page, AJAX client side framework fails to load. I observed the problem deeply and found that whenever I'm on a subdomain page, WebResource.axd DOES load but ScriptResource.axd DOESN'T load (returns 404 Not Found error). I think I should modify some entries at web.config file, but I have no idea on what to do?
In my website i have used ajax. I have made a subdomain. All the files are in the subdomain. But no ajax controls are working. When viewing source,
In our test environment, with the same code, everything works fine. This tells me there was something on the production server that's preventing this from working. About 4 days before this started happening, we found that some user documentation (PDF) wasn't being protected by Forms Authentication (we need only legitmate users having access to it) so we added a wildcard mapping in IIS with "verify that file exists" was unchecked, knowing that if it were checked, we'd have this problem. I had one of the network admins check this setting after this started happenig and he said that it was still unchecked. I asked him to remove the wildcard mapping altogether and I still see the same behavior.
I am certain that this isn't a coding problem; again, as it went through the QA process in our test environment, everything works perfectly. And after the last deployment to production three weeks ago, everything was perfect as well. We added the wildcard mapping (which shouldn't have had an effect) and four days later the site breaks. I've asked our IT department if any changes were made to the server recently and nobody says they did.
What settings does anyone know of that might be causing this, either server or application? I checked the web.config and all the sections are there that deal with the ScriptResource HttpHandler and HttpModules. In fact, the web.configs are identical between the production and test environment, so I know it hasn't been tampered with.
I have page that works ok on localhost, but it throws an error on server. This pages was working ok before until I added additional grid to updatePanel. Is there any limit how many grids you can have in updatePanel. The error message is below.
Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 Line: 4723 Char: 21 Code: 0
We host a SaaS application on 4 windows 2008 servers loadbalancer via a LVS. We use infragistics and Ajax Control Toolkit on several pages, one page represents a list of people using a Web Datagrid, each time a person is clicked in the list, an Ultra Web Tab component is updated at the botom of the page with detailed information on that person. After a certain amount of clics on different people (number of clics can be between 1 and 5) Scriptresource.axd craches with the following error :
I don't get this error when I run my application on one server using the server's private IP adress. I tried to synchronize the dates of the dlls System.Web and System.Web.Extensions on each server, I still get the same error.
I use ASP.NET Ajax in my web site and I am monitoring the HTTP requests per each page. I am surprised by the excessive call of ScriptResource.axd with different query string variables. I am pasting a sample of HTTP trace below. The call for ScriptResource.axd take lots time percentage out of total response time. Is this by design or there is something wrong with my AJAX configuration in web.config?
Actually it is degrading the performance of the application. And the user experience becoming very poor in case of lower bandwidth.
I had to rebuild my development environment after my hard drive crashed. Before the crash I used ScriptManager with CompositeScript tags to combine js files using AjaxControlToolkit, version 3.0.20820.29441. Now I am forced to use AjaxcontrolToolkit version 3.5.40412.0 which insists that I use ToolkitScriptManager which seems to combine ALL Ajax controls instead of the ones I specifiy in CompositeScript. And when I use the attribute CombineScriptsHandlerUrl="~/CombineScriptHandler.ashx" (the latter from SampleWebSitethat comes with AjaxControlToolkit) I see in Fiddler that the ashx file cannot be found.
Problem: This problem occurs only in one client machine running IE8. I believe that it is a configuration/component problem because I also running IE8 and it works fine. Following error message pop up every time when the button is click inside the update panel.It occurs once I try to click a button inside the updatePanel. Controls inside updatePanel disappears, and the updateProgress keep running.
I tried so many solutions including following
Changing the Web.config with "~/scriptResource.axd" There is no timer control from AjaxControlToolkit on the page. I have checked modified dates, which are correct on the AJAX Control Tool Kit assemblies as accepted.if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded(); I have tried many other options with out any luck. Looks like the required ScriptResource.axd file is not getting loaded on that particular client machine due to some reason, which i can not find out. This problem occurs only in one client machine running IE8, that's making testing problematic for me.
My Configuration includes the following .NET Frame Work 2.0 with AJAX Control Tool Kit Library (1.0.61025)
Error message : Error: [Exception... "'Sys.ScriptLoadFailedException: Sys.ScriptLoadFailedException: The script 'http://gateway/ApplicationName/ScriptResource.axd?d=pXGxsCxfFpN7YoDKJe9ANJUGdhhEYXdDvlJNvZyr3dWA3jxhYKmHBTZXvAXPr8NFAZhv6MOINf4Ktd7XCgzHFg2&t=633372084573906250' failed to load. Check for: Inaccessible path.......
I have a jQuery function in a .js file, and the function requires a querystring parameter to be passed. If I try to use the CompositeScript feature in the ScriptManager, it pukes on the file that has the querystring.
My page loads scripts and css from some custom assembly. For now, I use the ScriptManager to add scripts to the page (its CompositeScript) and the page's ClientScript.GetWebResourceUrl() for css files. So, on the page(s) my scripts are referenced by /ScriptResource.axd and css are referenced by /WebResource.axd. Works fine except the fact that those URLs look really ugly. Is there any manageable way to replace those urls with my own fake paths without moving/hosting script/css physical files somewhere?
Scenario: I have a complex Asp.net app serving various units through programmatically constructed control collections in HttpModules. Some of these controls use Asp.NET Ajax.
Across many different units, ScriptResource.axd averages a transfer size of ~27k.
I have a ceiling that only allows ~3k for it.
There definitely isn't time to retrofit all the Ajax functionality with jQuery or hand-rolled js functions or whatnot. We already have the .axd coming over with gzip encoding (uncompressed it's more like 97k). It's often cached, but that doesn't matter: I have to hit a hard, low, externally-imposed limit on first-request total transfer size... markup, scripts, images & all summed up a-la firebug. I've been avoiding the .axds, but there really isn't anywhere else to shave bytes, and I have 24k to go.
Possible approaches: I'm not yet using Asp.NET 3.5 SP1's compositescript functionality, but I figure that would only save on request/response headers, and I'm not even sure headers count against me.
I don't have any other ideas other than something radical, like creating a response filter that uses reflection & some dictionaries to figure out what js functions are actually needed, and only emit those. I could cache the resulting list for each unit, since I have a low response time ceiling as well, and I don't think the .axds change from one request to another. Is this feasible? Any other ideas? ...what if I buy beer for the hero with a solution?