Register your client script so that it is rendered in the <head> of a document rather than in the default .NET <form> tag. Typically used in master pages.

// Register included script
ScriptAide.CurrentContext.RegisterInclude("MyScripts", UrlAide.Resolve("~/js/my-scripts.js"));

// Register script block
ScriptAide.CurrentContext.RegisterBlock("SayHello", "<script type=\"text/javascript\">alert('Hello!');</script>", false);

Built in JavaScript Libraries

DNAide include a number of JavaScript libraries embedded as resources. These include:
  • jQuery (and a number of jQuery extensions)
  • SwfObject
  • ActiveXObject (based on SwfObject)

Helper methods are supplied so you can easily use these in your website:
  • ScriptAide.CurrentContext.RegisterDNAideScriptResource
  • ScriptAide.GetDNAideScriptResourceUrl

// Register jQuery in a document's <head>

Last edited May 27, 2007 at 8:24 PM by stebrennan, version 1


No comments yet.