473,386 Members | 1,873 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,386 software developers and data experts.

can't put a url into the value of a key in appSettings (web.config)

in web.config, I want to have a key in appSettings:

<add key="Url" value="http://gisbox/mypage.htm?action=state&city="/>

But that value doesn't take... I get an error saying it expects a semicolon.
Any idea why? If I just put value = "abc" it works fine.

TY
Jason Shohet
Nov 18 '05 #1
5 1922
&'s are a quote character in xml, try:

<add key="Url" value="http://gisbox/mypage.htm?action=state&amp;city="/>

-- bruce (sqlwork.com)
" Jason Shohet" <as****@hotmail.com> wrote in message
news:#S**************@tk2msftngp13.phx.gbl...
in web.config, I want to have a key in appSettings:

<add key="Url" value="http://gisbox/mypage.htm?action=state&city="/>

But that value doesn't take... I get an error saying it expects a semicolon. Any idea why? If I just put value = "abc" it works fine.

TY
Jason Shohet

Nov 18 '05 #2
replace the "&" with "&amp;" without the quotes.
" Jason Shohet" <as****@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
in web.config, I want to have a key in appSettings:

<add key="Url" value="http://gisbox/mypage.htm?action=state&city="/>

But that value doesn't take... I get an error saying it expects a semicolon. Any idea why? If I just put value = "abc" it works fine.

TY
Jason Shohet

Nov 18 '05 #3
replace the '&' with '&amp;'

you will be fine...

HTD

HD

" Jason Shohet" <as****@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
in web.config, I want to have a key in appSettings:

<add key="Url" value="http://gisbox/mypage.htm?action=state&city="/>

But that value doesn't take... I get an error saying it expects a semicolon. Any idea why? If I just put value = "abc" it works fine.

TY
Jason Shohet

Nov 18 '05 #4
Jason,

Try this instead:

<add key="Url" value="http://gisbox/mypage.htm?action=state&amp;city="/>

Any URLs that you put here must be URL encoded.
Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
ja******@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
From: " Jason Shohet" <as****@hotmail.com>
Subject: can't put a url into the value of a key in appSettings (web.config)Date: Tue, 23 Dec 2003 14:00:08 -0500
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#S**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: 222-234-234-66.cosmoweb.net 66.234.234.222
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
phx.gbl!tk2msftngp13.phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:198029
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

in web.config, I want to have a key in appSettings:

<add key="Url" value="http://gisbox/mypage.htm?action=state&city="/>

But that value doesn't take... I get an error saying it expects a semicolon.Any idea why? If I just put value = "abc" it works fine.

TY
Jason Shohet


Nov 18 '05 #5
You guys are great.
That did the trick.
Jason Shohet
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Frankie | last post by:
I'm writing a small utility app (C# Windows forms) used to create new ASP.NET Web sites. This utility needs to be able to change existing values in an existing Web.config. Please note: I do NOT...
2
by: Jared Hagel | last post by:
I've searched the web for a solution to this problem. Surprisingly, no problem/solution has been posted yet. We can read application configuration information fine when our asp.net application...
1
by: somequestion | last post by:
i work on asp.net 2.0 so i have to change property of web.config file on the web page i mean when i make a board i want to change PageSize in the web.config file. so i use...
2
by: mahesh.anjani | last post by:
hi i have stored my connction string in web.config as we do usually. code of web.confing is given below. check the password field contain "&" character. now when i run my application it gives...
0
by: -Steve- | last post by:
I've encrypted the appsettings in my web.config file using the following command: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -pe "appSettings " -app "/passwordReset" ...
2
by: Jon Paal | last post by:
..net 2.0 can't retrieve connection string from web.config, always returns error message -- what's missing ?? ======web.config ========= <appSettings> <connectionStrings> <add...
1
by: Sergei Shelukhin | last post by:
Hi. Is is possible to divide appSetting in two, having some values stored in web.config itself and some in a section referenced in appSettings file="...." attribute?
2
by: remya1000 | last post by:
i'm using VB.NET 2003. Last time while i did a program in Vb.Net 2005, i use "Configuration". and i could read and write to that XML configuration file like the example below. CODES:...
5
by: daokfella | last post by:
I have a custom web.config section similar to the following: <CustomAuthSettings attr1="" attr2=""> <Locations RedirectUrl="Invalid.aspx"> <add Path="test.aspx" Roles="1,2,3" Permissions="4,5,6"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.