"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>