Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am use following code for show icon in address bar

ASP.NET
<link rel="shortcut icon" type="image/ico"  runat="server" href="~/images/Icons/db(1).ico"   />


Here i need to pass image url to href from web config value,so once i change image url in web config in all address bar image affect.

In web config have like this

HTML
<add key="AddressBarImage" value="~/images/Icons/db(1).ico" />


I try like this but not work

ASP.NET
<link rel="shortcut icon" type="image/ico"  runat="server" href="<%$AppSettings:AddressBarImage %>"   />


Any idea ?

Note:if only in login page we manually change image url in href,but we have login,admin,main,sub main etc,so in all page need to change address bar image url once change url in web config.


Regards
Aravind
Posted
Updated 28-Jul-15 20:06pm
v2
Comments
Sreekanth Mothukuru 29-Jul-15 4:54am    
Try this

<link rel="shortcut icon" type="image/ico" runat="server" href="<%$ ConfigurationSettings.AppSettings["AddressBarImage"] %>" />
Aravindba 29-Jul-15 5:05am    
it show following error
Error 206 The server tag is not well formed. C:\inetpub\wwwroot\LoadMore\login.aspx 9

Error 207 Literal expressions like '<%$ ConfigurationSettings.AppSettings["ProdImage"] %>' are not allowed. Use <asp:Literal runat="server" Text="<%$ ConfigurationSettings.AppSettings["ProdImage"]%>" /> instead. C:\inetpub\wwwroot\LoadMore\login.aspx 9

1 solution

Try the following

In code behind

mylink.Href = "~/favicon1.ico";
You can also try providing dynamic path above and check
 
Share this answer
 
Comments
Aravindba 3-Aug-15 6:54am    
Thanks....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900