Referencing Scripts Using Assembly/Name
When creating script references for AJAX controls, you may have noticed this code a lot:
var r = new ScriptReference(Page.ClientScript.GetWebResourceUrl(...));
This method creates a unique URL using a custom HTTP handler that extracts scripts from within the DLL. This unique URL gets assigned to the path property. There is an easy alternative to this if you don't want to use GetWebResourceUrl.
By specifying the name of the assembly and the name of the type, the embedded script can be exctracted in this alternative way, as in:
var r = new ScriptReference();
r.Assembly = assemblyName;
r.Name = clientSideTypeName;
For me, this alternative approach circumvented a customized solution to registering AJAX components; for the average user, using GetWebResourceUrl will suffice in registering scripts. But it's not necessary. If you have the type of a component that has the embedded resource, you can extract a reference to the Assembly through the Type metadata class.