Sharepoint JS CSS 注册

【转 http://www.cnblogs.com/ruijian/archive/2012/04/18/2455863.html

前台注册

适用于2010VisualWebpart,应用程序页

   1: <SharePoint:ScriptLink Language="javascript" ID="jqueryScriptLink" Name="/_layouts/tgUI/jquery-1.6.4.js" Defer="false" runat="server"/>
   1: <SharePoint:CssRegistration  ID="SDCSSLink"  Name="/_layouts/tgUI/pagestyle.css" runat="server"/>

 

后台注册

适用于2007Webpart,在CreateChildControls中添加

   1: ScriptLink JqueryJSLink;
   2: JqueryJSLink = new ScriptLink();
   3: JqueryJSLink.ID = "JqueryJSLink";
   4: JqueryJSLink.Language = "javascript";
   5: JqueryJSLink.Name = "/_layouts/tgUI/jquery-1.6.4.js";
   6: this.Controls.Add(JqueryJSLink);

 

   1: CssRegistration jstreeCSSLink;
   2: jstreeCSSLink = new CssRegistration();
   3: jstreeCSSLink.ID = "jstreeCSSLink";
   4: jstreeCSSLink.Name = "/_layouts/tgUI/jstree/themes/default/style.css";
   5: this.Controls.Add(jstreeCSSLink);

 

你可能感兴趣的:(SharePoint)