【发布时间】:2014-05-08 14:23:12
【问题描述】:
我有一个难题,我希望我能在这里得到澄清。
我有一个母版页,其中有一个内容占位符,所有其他子页都使用它:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title><%: Page.Title %></title>
<!--[if !IE]> -->
<link rel="stylesheet" href="theStyles/adipoli.css" type="text/css" charset="utf-8" />
<!-- <![endif]-->
<script type="text/javascript" src="theScripts/placeholders.jquery.min.js"></script>
<script type="text/javascript" src="theScripts/jquery.appear.js"></script>
<!-- default stylesheets -->
<link rel="stylesheet" type="text/css" href="theStyles/defaultStyle.css" />
<link rel="stylesheet" type="text/css" href="theStyles/captionStyle.css" />
<link rel="stylesheet" type="text/css" href="theStyles/footerLinks.css" />
<!-- end default stylesheets -->
<!-- if IE version 9 or less -->
<!--[if lte IE 9]>
<link rel="stylesheet" type="text/css" href="theStyles/defaultStyle_ie.css" />
<link rel="stylesheet" type="text/css" href="theStyles/captionStyle_ie.css" />
<![endif]-->
</head>
<body>
<form runat="server">
<asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
<!-- ################################################################################ -->
<!-- ### ### -->
<!-- ### The below contents will be visible in every page unless otherwise stated ### -->
<!-- ### ### -->
<!-- ################################################################################ -->
<!-- ### BEGIN LEFT SIDE MENU ### -->
<!-- ### END LEFT SIDE MENU ### -->
<!-- ### BEGIN TOP RIBBON ### -->
<div id="headerRibbon">
<span id="socialIcons">
<asp:HyperLink title="Compant Homepage" href="Default.aspx" ClientIDMode="Static" runat="server">
<asp:Image src="theImages/wmlogo.png" width="219" height="47" alt="Compant Medical Group Homepage" title="Compant Medical Group Homepage" runat="server" />
</asp:HyperLink>
</span>
<div id="tSearch">
<!--[if lte IE 8]>
<input id="searchText" name="" type="text" size="40" placeholder="Search Compant" />
<![endif]-->
<!--[if gte IE 9]><!-->
<asp:TextBox ClientIDMode="Static" ID="searchText" size="40" placeholder="Search" runat="server"></asp:TextBox>
<!--<![endif]-->
</div>
</div>
<!-- ### END TOP RIBBON ### -->
<!-- ### BEGIN BOTTOM RIBBON ### -->
<div id="strip">
</div>
<div id="footerRibbon" class="footerRibbon">
<asp:Label runat="server" ClientIDMode="Static" ID="copyRight" Text="© 2009-14 COMPANY"></asp:Label>
</div>
<!-- ### END BOTTOM RIBBON ### -->
<script type="text/javascript" src="theScripts/defaultScript.js"></script>
</form>
</body>
</html>
关于我们:
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="about.aspx.cs" Inherits="about" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="FeaturedContent">
</asp:Content>
联系方式:
<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="contact.aspx.cs" Inherits="contact" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="FeaturedContent">
</asp:Content>
这是它的外观快照:
我的问题是,如果 aboutus 页面中有 Webparts 有它自己的 HTML 代码,我希望某些用户能够对其进行编辑。我设置母版页的方式可以实现吗?还是我必须为每个子页面设置单独的 contentplaceholder 才能实现它?
【问题讨论】:
-
Webparts是什么意思?使用它可以轻松编辑 body 标签内的内容。 -
在 SharePoint 中,Webpart 几乎是可编辑的内容。我可以在内容占位符内添加 Webpart 吗?
-
另外,我会从母版页中删除
form runat=server并将其添加到需要的特定页面中 -
不知道这是可能的。感谢您的提示:)
-
我不确定
webparts是什么。您应该添加有问题的sharepoint标签。只要您想在body标签中添加一些东西,您就应该很好。但从母版页中删除runat=server
标签: html asp.net css sharepoint-2013 contentplaceholder