×
您的位置: 首页 > 编程笔记

在增加的ContentPlaceHolder标题添加第二个空标题标签(Adding title in contentplaceholder adds second empty title tag)

Android 时间:2020-06-18  查看:746   收藏

My master page has a contentplaceholder in the head tag.

Because I want my page's title to represent the function of the current page and because I want the title to be translated in the user's language I have added a title tag in the page's head's contentplaceholder. All jolly and good except that now there appears a second, empty title tag that off course isn't valid.

Any ideas how to solve this?

解决方案

I ran into the same problem and found a solution that seems to work. It's pretty hacky but at the same time pretty simple. Just add another title tag in the head, put a runat="server" attribute inside it and then set it's visibility to false:

<title visible="false" runat="server"><%-- hack to turn the auto title off --%></title>

我的母版页有头标记一个的ContentPlaceHolder。

由于我希望我的网页的标题,重新present当前页面的功能,因为我想要的标题在我添加在页面的头部的的ContentPlaceHolder标题标签用户的语言进行翻译。所有的快乐和良好的不同之处在于现在有出现第二个,空标题标记,关闭过程是无效的。

任何想法如何解决这个问题?


解决方案

我遇到了同样的问题,发现,似乎工作的解决方案。这是pretty哈克,但在同一时间pretty简单。只需添加另一个标题标签的头部,把=服务器属性中,然后设置它的可见性设置为false:

 &LT;标题可见=假=服务器&GT;&LT;% - 破解打开自动标题关 - %&GT;&LT; /标题&GT;

 

0% (0)
0% (0)