SharePoint【學習筆記】– Sharepoint JS CSS 註冊

來源:互聯網
上載者:User
前台註冊

適用於2010VisualWebpart,應用程式頁

<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"/>

 

後台註冊

適用於2007、2010Webpart,在CreateChildControls中添加

ScriptLink.Register(this.Page, "tgUI/jquery-1.6.4.js", false);

推薦上面這種方式,避免重複註冊;且能產生緩衝安全 URL,提示找不到該檔案

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);

 

 
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.