我的母版页如下所示:
<head runat="server">
<title>
<asp:ContentPlaceHolder ID="PageTitlePlaceHolder" runat="server" />
</title>
内容页面如下所示:
<asp:Content ID="TitleContent1"
ContentPlaceHolderID="PageTitlePlaceHolder" runat="Server">
My Page
</asp:Content>
这是通过在页面上放置特定于内容页面的标题(本例中为“My Page”)来实现的。现在,我想在母版页中为站点名称的标题添加一个全局前缀。所以我想:
<head runat="server">
<title>
Example.com:
<asp:ContentPlaceHolder ID="PageTitlePlaceHolder" runat="server" />
</title>
然而,当我这样做时,内容页面仍然呈现在标题中没有"Example.com“的情况下,就像被忽略了一样。
为什么会发生这种情况,我如何实现这一点?
https://stackoverflow.com/questions/3571618
复制相似问题