显示Defalut或空白Favicon [英] Displaying a Defalut Or Blank Favicon

查看:92
本文介绍了显示Defalut或空白Favicon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guys,



我要求不要在几页上显示图标。所以,要做到这一点

我已经提到链接标记的href属性为空白(href =)以使favicon消失。但遗憾的是,这并不像我预期的那样工作,它仍然显示位于根文件夹下的favicon。



任何人都可以帮助或提供有价值的建议。我想在我不想展示我的实际图标的页面上显示 defalut favicon / blank favicon







谢谢

Yashwanth

解决方案





你必须在你的母版页上设置这样的图标:

 <   link     id   =  favicon    rel   = 快捷图标   类型  =  image / png     href   =  favicon.png    /  >  





您应该只能在视图数据中传递所需图标的名称并将其放入head标签中。例如,您可以通过更改此链接上的HREF元素来更改相应页面的favicon(假设您正在使用JQuery):

 

#favicon)。attr( href favicon2.png);





另一种方式可以是,你可以添加这样的图标:

 <   link     runat   =  server    rel   = 快捷方式图标    href   =      type  < span class =code-keyword> =  image / x-icon   < span class =code-keyword> /  >  
< link runat = server rel = icon href = type = image / ico / >





和.aspx.cs:

  protected   void  Page_Load( object  sender,EventArgs e) 
{
Lin k1.Attributes.Add( href favicon.ico);
Link1.Attributes.Add( href favicon.ico);
}





查看此内容:



http://thelazybubble.blogspot.in/2011/ 08 / add-dynamic-fevicon-to-your-websites-in.html [ ^ ]



希望这有帮助! :) :)



问候,

Praneet


Hello Guys,

I having a requirement of not displaying the favicon on few pages. So, to do that
I have mentioned the href attribute of link tag to blank (href="") to make favicon disappear. But unfortunately this is not working as I expected and it still displays the favicon which is placed under root folder.

Can any one help or provide your valuable suggestions on this. I want to display a defalut favicon/blank favicon on the pages on which I dont want to show my actual favicon.



Thanks
Yashwanth

解决方案

Hi,

You must have set the favicon on your master page like this:

<link id="favicon" rel="shortcut icon" type="image/png" href="favicon.png" />



You should be able to just pass the name of the icon you want along in the view data and throw it into the head tag. You can change the favicon for the respective page using Javascript by changing the HREF element on this link, for instance (assuming you're using JQuery):


("#favicon").attr("href","favicon2.png");



Another way here could be, you can add favicon like this:

<link runat="server" rel="shortcut icon" href="" type="image/x-icon" />
<link runat="server" rel="icon" href="" type="image/ico" />



And in .aspx.cs :

protected void Page_Load(object sender, EventArgs e)
{
    Link1.Attributes.Add("href", "favicon.ico");
    Link1.Attributes.Add("href", "favicon.ico");
}



Check this out:

http://thelazybubble.blogspot.in/2011/08/add-dynamic-fevicon-to-your-websites-in.html[^]

Hope this helps !! :) :)

Regards,
Praneet


这篇关于显示Defalut或空白Favicon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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