473,396 Members | 2,029 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,396 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 26412
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.