惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - A A

SharePoint 2013 App 未在此网站上启用应用程序的旁加载 SharePoint Error 查询命令 SharePoint 2013 基于主机头创建站点无法访问 SharePoint 2013 APP 之---很抱歉,应用程序已关闭。如果您知道运行服务器的人员,请告诉他们启用应用程序。 SharePoint服务器修改域和机器名 CAML 多表查询 SPQuery.Joins and ProjectedFields SharePoint 2010 你状态机了吗! SharePoint 文档库打开HTML 直接浏览而不是打开下载对话框 SharePoint Write Logs User Profile Data Web Part 读取属性字段 ECMAScript Client OM(传说中的js客户端编程) - A A 自定义个性化 EditPeople控件 - A A 使用SharePoint Management PowerShell来完成对SharePoint的操作 Developer Dashboard 排忧解难!!! 使用SharePoint 人员选择控件 在 WEB APP开发 - A A SharePoint 在Default 下面添加服务端代码 - A A 10分钟搞定 SharePoint 集成FCKEditor 标准项目文档 获取AD用户和OU属性字段名称
SharePoint 页面库 使用footer - A A
A A · 2010-08-23 · via 博客园 - A A

图片:

我们只需要在我们的page Content Type里面定义好我们的模板就可以

User Controls Code:

<%@ Control Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.Administration" %>
<script runat="server">
    string stLastModifiedDate = string.Empty;
    string stLastModifiedBy = string.Empty;
    string stLastModifiedByMemberID = string.Empty;   
   
    string stTxt = string.Empty;
    public string FileName()
    {
        return System.Web.HttpContext.Current.Request.Url.AbsolutePath;
    }
    void Page_Load(object sender, EventArgs e)
    {
        string stPageName = FileName();
        using (SPSite RootSite = new SPSite(Page.Request.Url.ToString()))
        {
            using (SPWeb SiteCollection = RootSite.OpenWeb())
            {
                string stPath = RootSite.MakeFullUrl(stPageName);
                SPFile File = SiteCollection.GetFile(stPath);
                DateTime dateLastModifiedDate = File.TimeLastModified;
                stLastModifiedDate =
                  SiteCollection.RegionalSettings.TimeZone.UTCToLocalTime(
                  dateLastModifiedDate).ToString();
               
                SPUser ModifierUser = File.ModifiedBy;
                stLastModifiedBy = ModifierUser.Name.ToString();
                stLastModifiedByMemberID = ModifierUser.ID.ToString();
                stTxt = "Last modified by:<a onclick=\"GoToLink(this);" +
                  "return false;\" href=\"../_layouts/userdisp." +
                 "aspx?ID=" + stLastModifiedByMemberID +
                 "\">" + stLastModifiedBy +
                 "</a>  " + stLastModifiedDate;
            }
        }
    }
</script>
<table class="pageFooter">
    <tr>
        <td>
            <%= stTxt %>
        </td>
    </tr>
</table>

CSS 文件:

<style type="text/css">
.pageFooter
{   font-family:Arial;
    font-size:10px;
    color:#4d4d4d;
    line-height: 12px;

}

.pageFooter A:link
{
    color:#8b9700;
}
</style>

使用的时候,只需要把这个用户控件插入到指定的地方,

方法:

注册:

<%@ Register TagPrefix="Flygare"
    TagName="PageFooter" src="~/_controltemplates/PageFooter.ascx" %>

在需要使用页脚的Content type 

插入

<Flygare:PageFooter id="PageFoot" runat="server" enableviewstate="true">
</Flygare:PageFooter>

 其实这种方法不是最好的,可是我们可以通过这种方法,举一反三,写一些很好的feature的东西

比如我们可以在用户控件里面写很多客户定制化的东西,然后在指定的地方插入。比写webpart要简单的多~~~~

- - ||