473,653 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Adrian

"Eidolon" <aa****@yahoo.c om> wrote in message
news:eD******** ******@tk2msftn gp13.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
4110
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? I can't find this reported anywhere else. I may just have to code around it. Details: link is created by the following code: <a>href="GroupDetails.asp?groupName=<%=Server.URLEncode(objRecordset("Group_Name"))%>">Group Details</a> If...
4
3125
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"?> <configuration> <appParams> <add key="ConnectionString" value="User
41
10656
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 = String.Format("SELECT * FROM dbo.documents WHERE ") & query End Sub
13
26437
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 'confirmationMessage' querystring unless I do NOT encode the ampersand. I assume I'm missing something obvious here. Any suggestions?
3
312
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 following error: ---------------------------------------------------------------------------- ------------------------------------------------ Parser Error Message: This is an unexpected token. The expected token is 'SEMICOLON'. Line 70,...
13
2536
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 report with a multiple-value discrete value and a rangevalue. The report shows fine in the viewer, but when I hit the export to pdf
8
1786
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 have a procedure that must take information from the app.config file of Project1. In the clsproject2 I need to write code that gets the value of a setting in the app.config file of Project1. I find that the code I had that seemed to work ijn Vs2003...
3
6655
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=" & HTTPUtility.URLEncode("500 Rt 6 & 209") and then to retrieve it: txtAddress1.text = Request.Querystring("AD1") However, in a different page of code, I loop through the QueryString.AllKeys collection like this:
3
9741
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 seem to work...however, once the application is closed and reopened the changes are lost. How do I persist the information? Here is some sample code using both methods: //////Using Properties.Settings///////
0
8370
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8590
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.