This post describes the Script Resource Viewer, a tool that I have written to help developers understand and debug problems with the WebResource and ScriptResource HTTP Handlers. You can download the Script Resource Viewer on the .NET Internationalization
site’s download page here
The src attribute of these script elements points to the WebResource and ScriptResource HTTP handlers and pass in two parameters: d (data) and t (time). Whereas the t parameter is simply a number of ticks and represents the time of the assembly file from which the resource was drawn the d parameter is not nearly so easy to understand because it is encrypted. Enter the Script Resource Viewer.
The first thing you will notice about the Script Resource Viewer is that it is as ugly as sin. I admit it - it’s the kind of ugly that frightens small children. I think it’s fair to say that my talents lie more on the functionality side of software development than the aesthetically pleasing user interfaces side of software development.
The second thing that you will notice is that there is a big box where you can paste in a WebResource or ScriptResource from one of your pages. I have pasted in the fourth line from examples above and clicked on the Decrypt button. (If the Script Resource Viewer fails at this point the most likely explanation is that you are attempting to decrypt a string generated by one version of the ASP.NET AJAX Framework on a machine with a different version of the ASP.NET AJAX Framework. Try rebuilding generating a fresh page on the same machine and using the WebResource or ScriptResource from that page).
The Decrypt button decrypts the d and t parameters and breaks them down into recognisable fragments. In this example you can see that the first character is Z (indicating that the result should be returned GZipped), the second parameter is the assembly name (AJAXWebEnabledApplicationI18N1), the third parameter is the fully qualifed resource name to retrieve from the assembly (AJAXWebEnabledApplicationI18N1.DisplayFunctions.js) and the fourth parameter is the culture to return the resource for (fr, i.e. French).
The "Show Resource Uri" button rebuilds a URI from the value in the "Server Uri" field and the decrypted d and t parameters. However, there is an all-important difference between the original URI passed to ScriptResource and the rebuilt URI (apart from the Server Uri prefix). The first character of the d parameter is a u and not a Z. The difference means that the ScriptResource will return unzipped script instead of GZipped script. Th