簡體   English   中英

在我的SharePoint主頁中顯示當前年份

[英]Displaying the current Year inside my SharePoint master page

我正在SharePoint 2013團隊網站上工作。 在seatle.master頁面中,我定義了以下內容:

<div id="customFooter"  class="noindex">&copy; .. Group 2013</div>

但是我不確定是否有一種方法可以從我的母版頁訪問Date對象,然后顯示當前年份而不是手動鍵入年份。 這將需要在一年后進行更新。 謝謝

試試這個

<div id="customFooter" class="noindex">
     &copy; .. Group <%=DateTime.Now.Year.ToString() %>
</div>

嘗試這個:

<div id="customFooter" class="noindex"> &copy; .. Group <script type="text/javascript">document.write(new Date().getFullYear());</script> </div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM