By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,919 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,919 IT Pros & Developers. It's quick & easy.

How: Ampersand in AppSettings value??

P: n/a
I am wondering how i can put an ampersand character into the value attribute
of a key in the appSettings section of my web.config file. If i try to
simply type it in, then run my web app, i get the following error:
----------------------------------------------------------------------------
------------------------------------------------
Parser Error Message: This is an unexpected token. The expected token is
'SEMICOLON'. Line 70, position -3896.

Source Error:

Line 68: </system.web>
Line 69: <appSettings>
Line 70: <add key="specsheet"
value="http://dev.domain.com/products/prodspecs.aspx?atrs=y&prodid=" />
Line 71: </appSettings>
Line 72: </configuration>
----------------------------------------------------------------------------
------------------------------------------------
I've tried to escape the character as "\&" but that didnt do anything.

Thanks in advance,
- Aaron.
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try &amp;

Adrian

"Eidolon" <aa****@yahoo.com> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
I am wondering how i can put an ampersand character into the value attribute of a key in the appSettings section of my web.config file. If i try to
simply type it in, then run my web app, i get the following error:
-------------------------------------------------------------------------- -- ------------------------------------------------
Parser Error Message: This is an unexpected token. The expected token is
'SEMICOLON'. Line 70, position -3896.

Source Error:

Line 68: </system.web>
Line 69: <appSettings>
Line 70: <add key="specsheet"
value="http://dev.domain.com/products/prodspecs.aspx?atrs=y&prodid=" />
Line 71: </appSettings>
Line 72: </configuration>
-------------------------------------------------------------------------- -- ------------------------------------------------
I've tried to escape the character as "\&" but that didnt do anything.

Thanks in advance,
- Aaron.

Jul 21 '05 #2

P: n/a
> Try &amp;

that works... thanks!

- Aaron.
Jul 21 '05 #3

P: n/a
Aaron,

Try using &amp; in place of the ampersand character or the
decimal code equivalent.

The following may be worth noting:-
http://msdn.microsoft.com/library/default.asp?
url=/workshop/author/dhtml/reference/charsets/charset1.asp

Ewen.
-----Original Message-----
I am wondering how i can put an ampersand character into the value attributeof a key in the appSettings section of my web.config file. If i try tosimply type it in, then run my web app, i get the following error:---------------------------------------------------------- ------------------------------------------------------------------
Parser Error Message: This is an unexpected token. The expected token is'SEMICOLON'. Line 70, position -3896.

Source Error:

Line 68: </system.web>
Line 69: <appSettings>
Line 70: <add key="specsheet"
value="http://dev.domain.com/products/prodspecs.aspx? atrs=y&prodid=" />Line 71: </appSettings>
Line 72: </configuration>
---------------------------------------------------------- ------------------------------------------------------------------
I've tried to escape the character as "\&" but that didnt do anything.
Thanks in advance,
- Aaron.
.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.