Front-end registration
For 2010 visualwebpart, application page
<SharePoint: scriptlink Language = "JavaScript" id = "jqueryscriptlink" name = "/_ layouts/tgui/jquery-1.6.4.js" Defer = "false" runat = "server"/> <SharePoint: cssregistration id = "sdcsslink" name = "/_ layouts/tgui/pagestyle.css" runat = "server"/>
Background Registration
For 2007 and 2010 webparts, add
Scriptlink. Register (this. Page, "tgui/jquery-1.6.4.js", false );
This method is recommended to avoid repeated registration. The cache Security URL can be generated and the file cannot be found.
Scriptlink jqueryjslink; jqueryjslink = new scriptlink (); jqueryjslink. id = "jqueryjslink"; jqueryjslink. language = "JavaScript"; jqueryjslink. name = "/_ layouts/tgui/jquery-1.6.4.js"; this. controls. add (jqueryjslink); cssregistration jstreecsslink; jstreecsslink = new cssregistration (); jstreecsslink. id = "jstreecsslink"; jstreecsslink. name = "/_ layouts/tgui/jstree/themes/default/style.css"; this. controls. add (jstreecsslink );