zoukankan      html  css  js  c++  java
  • Sharepoint JS CSS 注册

    前台注册

    适用于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"/>

    (2013-3-19)

    前台JS注册时不加/_layouts/才能生成缓存安全URL
    <SharePoint:ScriptLink Language="javascript" Name="tgUI/jquery-1.6.4.js" Localizable="False"  Defer="false" runat="server"/>
    库中: 
    1  <SharePoint:ScriptLink Language="javascript" Name="~sitecollection/Style Library/zh-cn/Themable/Core Styles/JS/jquery-1.6.4.js" Defer="false" runat="server"/>
    2 
    3 <SharePoint:CssRegistration ID="CssRegistration1" Name="/Style Library/Home/CSS/jcarousel.css" runat="server" After="corev4.css" /> 
    4 
    5 <SharePoint:CssRegistration ID="CssRegistration2" name="<% $SPUrl:~sitecollection/Style Library/~language/Themable/Core Styles/MTPublish.css %>" After="corev4.css" runat="server" EnableCssTheming="false"/>

    后台注册

    适用于2007、2010Webpart,在CreateChildControls中添加

    ScriptLink.Register(this.Page, "tgUI/jquery-1.6.4.js", false);
    推荐上面这种方式,避免重复注册;且能生成缓存安全 URL,提示找不到该文件
    image
     
       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);
    (2013-3-7)将CSS注册到Style Library中
    CssRegistration.Register(SPUtility.GetServerRelativeUrlFromPrefixedUrl("~sitecollection/Style Library/zh-cn/Themable/Core Styles/**.css”));
     
     
       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:ScriptLink测试

  • 相关阅读:
    教你Python3实现12306火车票自动抢票,小白必学
    Spring Security 中如何快速查看登录 IP地址等信息?一招搞定
    方程组及其解的判定
    向量空间
    极大无关组和向量组等价
    向量组的线性相关与线性无关
    向量间的线性关系
    向量的概念和运算
    矩阵的秩和秩的性质
    利用初等变换求逆矩阵和解矩阵方程
  • 原文地址:https://www.cnblogs.com/ruijian/p/2455863.html
Copyright © 2011-2022 走看看