View Full Version : Cleaning Up Image Code.

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?

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

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

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

aND You CaN CaLL iT LiKe...

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