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

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
&'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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
You guys are great.
That did the trick.
Jason Shohet
Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.