Question : Ampersand in Web.Config appSettings

I am using the AppSettings section of my Web.Config file to link a URL with a key value.  It works perfectly for every url I have except when an ampersand (&) is contained in the key value or url.  Does anyone know a way around this?  I have done a little research and have found suggestions to use & in place of the ampersand but that does not seem to work.  Any idea? Thanks.
1:
2:
3:
4:
5:
6:
<add key="RegScreen23" value="http://testurl/winmobile/MrPerformanceFuel_bb.asp"/>
    <add key="RegKey23" value="Meramec Performance Fuel"/>
    <add key="RegScreen24" value="http://testurl/winmobile/MrChemOverview1&amp;2_bb.asp"/>
    <add key="RegKey24" value="Meramec U1&amp;2 Chemistry"/>
    <add key="RegScreen25" value="http://testurl/winmobile/MrChemOverview3&amp;4_bb.asp"/>
    <add key="RegKey25" value="Meramec U3&amp;4 Chemistry"/>

Answer : Ampersand in Web.Config appSettings

Hi rkneal,

Technicaly the &amp should work if the compiler wouldnt fail to put in URL-format instead of HTML-format!
So instead of using &amp try using %26, %26 is the URL-encoding of the char &

Example below in code!

Greetz!

ps: let me know if it works or not, i'm not on a testing pc for the moment!
1:
2:
3:
4:
5:
6:
<add key="RegScreen23" value="http://testurl/winmobile/MrPerformanceFuel_bb.asp"/>
    <add key="RegKey23" value="Meramec Performance Fuel"/>
    <add key="RegScreen24" value="http://testurl/winmobile/MrChemOverview1%262_bb.asp"/>
    <add key="RegKey24" value="Meramec U1&amp;2 Chemistry"/>
    <add key="RegScreen25" value="http://testurl/winmobile/MrChemOverview3%264_bb.asp"/>
    <add key="RegKey25" value="Meramec U3%264 Chemistry"/>
Random Solutions  
 
programming4us programming4us