Q:
I want to add favicon.ico
to my web application .so i add the icon to my solution then, i write the following:
Login page :
<link rel="shortcut icon" href="<%=ResolveUrl("~/favicon.ico")%>"/>
every thing is okay.
Master page of the other pages:
<link rel="shortcut icon" href="<%=ResolveUrl("~/favicon.ico")%>"/>
shows the following error :
The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>).
If i use <%#
instead and :
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
Page.Header.DataBind ();
}
Is this less performance ?and how to fix this problem?