473,395 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How: Ampersand in AppSettings value??

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
3 26409
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
> Try &amp;

that works... thanks!

- Aaron.
Jul 21 '05 #3
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: debk | last post by:
Server.UrlEncode is not longer converting the ampersand in a string to %26 so the value passed in the querystring gets truncated in the following page. Is this a problem with IIS, does anyone know?...
4
by: John Galt | last post by:
I am trying to read the "ConnectionString" value from my app.exe.config file, but am not sure of the format to do this. It is of the form: <?xml version="1.0" encoding="utf-8"?>...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
13
by: darrel | last post by:
I am creating a querystring to look like this: form_edit.aspx?collectionID=25&amp;confirmationMessage=New+form+entry+saved Note that I'm escaping the ampersand. However, I can't grab the...
3
by: Eidolon | last post by:
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...
13
by: Alison Givens | last post by:
....... that nobody knows the answer. I can't imagine that I am the only one that uses parameters in CR. So, my question again: I have the following problem. (VB.NET 2003 with CR) I have a...
8
by: Robert Dufour | last post by:
I have a winforms project Vs2005 with one project - Project1 which is the startup project and clsProject2 which is a class that is being used by Project1 (an exception handler). In clsProject2 I...
3
by: Elroyskimms | last post by:
I have to encode an address which contains an ampersand (&) into a URL with various querystring parameters. The following code works fine: URLString = "www.myserver.com?AD1=" &...
3
by: =?Utf-8?B?Sm9u?= | last post by:
Hello, I have tried to use the app.config and settings.cs files to store my data (which I want to be user changeable at runtime). I can write to (what I assume is an object in memory) and it does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.