[Dnn learning income] displaying website icons

Source: Internet
Author: User
Tags dnn

"Website icon"-the icon displayed in the address bar or favorites. Like Yahoo China.
To do this, you only need to add <LINK rel = "shortcut icon" href = "favicon. ICO "> force the browser to request this image.
Reading dnn todayCodeDnn also has this function (dnn is fully considered !). You only need to log on as a website administrator and upload the icon file to the root directory in the file management form of favicon. ICO. (Note: to upload a. ICO file, you must add the ICO file option to the file extension that is allowed to be uploaded in the host settings)
The functions are as follows:

Implementation Method in dnn:
1. Add the default. aspx File

< ASP: placeholder ID = "Favicon" Runat = "Server" > </ ASP: placeholder >

Add controls to the background code (this method can also be used to write JavaScript scripts to the page from the background, to control whether page copying is allowed, and to disable right-clicking, etc, this allows you to add configuration items in the host settings information, which is also an improvement)
2. On its background page:

Private   Sub managefavicon () Sub Managefavicon ()
' Read the website icon address from the cache
Dim Strfavicon As   String   =   Ctype (Datacache. getcache ( " Favicon "   & Portalsettings. portalid. tostring ), String )
If Strfavicon =   ""   Then
' If the website image address exists
If File. exists (portalsettings. homedirectorymappath &   " Favicon. ICO " ) Then
Strfavicon = Portalsettings. homedirectory &   " Favicon. ICO"
If   Not Common. globals. performancesetting = Common. globals. performancesettings. nocaching Then
' Write the information to the cache when the settings need to be cached.
Datacache. setcache ( " Favicon "   & Portalsettings. portalid. tostring, strfavicon)
End   If
End   If
End   If
' When the connection address of the website image is not equal to null, add it to the page
If Strfavicon <>   ""   Then
' Add a link tag HTML Control
Dim Objlink As Htmlgenericcontrol =   New Htmlgenericcontrol ( " Link " )
' Set the rel attribute to the shortcut cut icon.
Objlink. attributes ( " REL " ) =   " Shortcut icon"
' Set the icon path
Objlink. attributes ( " Href " ) = Strfavicon
' Add link to the favicon Control
Dim Ctlfavicon As Control =   Me . Findcontrol ( " Favicon " )
Ctlfavicon. Controls. Add (objlink)
End   If
End sub

In addition, there are many meta tags on the homepage. I checked its usage today and shared them with you:
Meta tag details>

More>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.