Script Resource Viewer

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.

If you have written ASP.NET AJAX applications and added ScriptReferences to the ScriptManager to refer to embedded JavaScript resources then you will have seen references to WebResource and ScriptResource in the generated page’s source at runtime. Here are the references from a simple web application:-

script src="/WebResource.axd?d=xzGDNKJs2hXyJqyidRG7rw2&t=633197888003670000" type="text/javascript"

script src="/ScriptResource.axd?d=cw0uZacoMljB_qHR-taqzzVXRZfsZdED8KtIdT8S4lxFp4FZiYkg1XMRiHm-
asNXbF50agKpU_mlwC_4UD1LjTtZIb8n0Iwtdp5j00hh_IM1&t=633200995411179848" type="text/javascript"

script src="/ScriptResource.axd?d=cw0uZacoMljB_qHR-taqzzVXRZfsZdED8KtIdT8S4lxFp4FZiYkg1XMRiHm-asNXbF50agKpU_mlwC_4UD1LjbQaIEzjJXk-
4Bu42FIEg4o1&t=633200995411179848" type="text/javascript"

script src="/ScriptResource.axd?d=Eayesv7vnHyEzSx83kYu3sZw_Ff6xhZWa9dVaMiOEVbTzulF5yuG_e_a0C
C6RS_16wJy1E10ZcWsesSXhTHQ2uyvpOmBnccO9vh7FSD3sP3P1nOe8f8kwq9qjkbsrs2H0&t=633203771948586000" type="text/javascript"

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

Currently rated 3.3 by 31 people

  • Currently 3.258065/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Wednesday, July 18, 2007 at 10:37 PM
Categories: AJAX
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

How To Search ASP.NET AJAX Documentation

One of the downsides with online HTML documentation such as that of ASP.NET AJAX is that the search facilities are either not as slick as searching .CHM or .HLP files or, as is the case for ASP.NET AJAX, they are non-existent. Of course, you can Google or Live it but then you have to filter out all of the noise. Colleague Pat Long took the obvious step and created a custom Google search solely for the ASP.NET AJAX documentation. You can get at it here:-

http://www.google.com/coop/cse?cx=012161591400813264642%3Ayziniunzfbo

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Thursday, May 10, 2007 at 10:47 PM
Categories: AJAX
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Book Review: Programming Atlas

AJAX Extensions (code named Atlas, hence the book’s title) is Microsoft’s soon to be released AJAX solution. AJAX Extensions is a set of JavaScript extensions that provide partial page rendering, asynchronous callbacks and cross browser compatibility. The AJAX Extensions Control Toolkit is a library of AJAX controls that add a wide array of client-side functionality to AJAX enabled applications. All in all Microsoft’s AJAX Extensions is very impressive.

Programming Atlas by Christian Wenz is one of two books (at the time of this review) that covers this new technology and it covers it well. The author writes clearly and authoritatively and includes a wealth of background knowledge around the subject. The book is well laid out and flows well. I get the feeling that the book had to be rushed to print quickly (probably due to the need to get the information out before it became obsolete by subsequent betas and CTPs) as there are many typos throughout the book. Personally I find this forgivable because the book is well written and I would rather have the information now than without typos later. There are also a number of omissions from the book. There is no discussion of client-side exception handling, adding debugging support, logging or using alternative asynchronous postbacks routes such as the IFrameExecutor. I would also liked the section on Data Binding to have included information on creating AJAX Extension controls that support data binding (as opposed to binding to existing AJAX Extension controls). There is also no discussion on localization of AJAX Controls but this can’t be levelled as a criticism of the book because at the time of writing AJAX Extensions doesn’t have a localization model. The book also shows the nature of writing before the technology is released because the book can’t possibly be up to date with the most recent releases: the name Atlas has been replaced by AJAX Extensions, namespaces have changed and several controls have changed.

Don’t let these deficiencies put you off though. If you’re into AJAX Extensions then this is a well written and authorative book that is well worth having.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Guy Smith-Ferrier
Posted on: Tuesday, October 31, 2006 at 8:07 AM
Categories: AJAX
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed