Logic to create ScriptResource code -- pulled from IL of System.Web.Extensions