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

查看:465
本文介绍了在增加的ContentPlaceHolder标题添加第二个空标题标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My master page has a contentplaceholder in the head tag.

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

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?

推荐答案

我遇到了同样的问题,<一个href=\"http://blogs.lotterypost.com/speednet/2007/07/aspnet-tip-how-to-$p$pvent-the-title-tag-fro.htm\"相对=nofollow>发现,似乎工作的解决方案。这是pretty哈克,但在同一时间pretty简单。只需添加另一个标题标签的头部,把=服务器属性中,然后设置它的可见性设置为false:

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标题添加第二个空标题标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆