...

View Full Version : Cleaning Up Image Code.



cnjcombo
12-03-2006, 01:28 AM
Currently I am doing clean up on my code and I would like to have my imageUrl's resort back to aliases in the web.config:

For example:

<asp: Image ID="imgHeader" RunAt="server" ImageUrl="imgHeaderPath" />

The imgHeader path would be assigned in the web.config.

What would the structure for that be in the web.config?

cnjcombo
12-03-2006, 05:49 PM
Heh, my thoughts exactly :confused:

Nischumacher
12-12-2006, 09:41 AM
THiS WiLL Go iN YouR 'Web.config'...

<configuration>
<appSettings>
<add key="imgHeaderPath" value="/foldername/imagename.jpg"></add>
</appSettings>
</configuration>

aND You CaN CaLL iT LiKe...

<asp: Image ID="imgHeader" RunAt="server" ImageUrl='ConfigurationSettings.AppSettings("imgHeaderPath")' />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum