Discussion:
Web service converts ' into '
Paul ten Brink
2007-02-20 16:21:53 UTC
Permalink
Efran Cobisi
2007-02-20 16:27:08 UTC
Permalink
Hi Paul,

Maybe you are looking for System.Web.HttpUtility.HtmlEncode() and
System.Web.HttpUtility.HtmlDecode() methods.
HTH,

Efran Cobisi
http://www.cobisi.com

Paul ten Brink wrote:
> Hello,
>
> A web service returns a string containing an apostrophe, but it is
> converted to its HTML code equivalent (see subject).
>
> (I am avoiding using the actual characters, since these could be changed
> by mail programs/services, which could make my question very confusing.)
>
> There is a simple conversion call, but I can't remember it and Googling
> does not help. Something like System.Convert...
>
> Can anyone help me out?
>
> Thanks in advance,
> Paul ten Brink
> ***@philips.com
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Mark Brackett
2007-02-20 16:38:47 UTC
Permalink
Paul ten Brink
2007-02-22 10:52:32 UTC
Permalink
Ryan Heath
2007-02-22 11:28:39 UTC
Permalink
On 2/22/07, Paul ten Brink <***@philips.com> wrote:
> HtmlEncode and HtmlDecode is exactly what I was looking for but could not
> find anymore...
>

When I know about method, but dont know its class anymore, I have
Reflector to the rescue!
Hit F3
Press CTRL+M
Type the methodname
See the class you forgot ;)

// Ryan

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Ian Suttle
2007-02-22 17:01:16 UTC
Permalink
Efran Cobisi
2007-02-22 17:01:31 UTC
Permalink
If you are referring to serialization, I think one way could be to set
up a property in your object of the XmlCDataSection type and mark it
with an XmlAnyElementAttribute attribute.
HTH,

Efran Cobisi
http://www.cobisi.com

Ian Suttle wrote:
> Decode is definitely one method. Does anyone know how to mark an
> element to use CDATA? If I wanted to return XML which had HTML content
> within an element, and use XSL to transform it, there's not really an
> opportune time to HtmlDecode the data.
>
> -----Original Message-----
> From: Discussion of building .NET applications targeted for the Web
> [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Paul ten Brink
> Sent: Thursday, February 22, 2007 2:53 AM
> To: DOTNET-***@DISCUSS.DEVELOP.COM
> Subject: Re: [DOTNET-WEB] Web service converts ' into &apos;
>
> Hi Efran and Mark,
>
> HtmlEncode and HtmlDecode is exactly what I was looking for but could
> not
> find anymore...
>
> Cheers!
>
> Paul ten Brink
> ***@philips.com
>
>
>
>> Date: Tue, 20 Feb 2007 17:27:08 +0100
>> From: Efran Cobisi <***@QBGROUP.IT>
>> Subject: Re: Web service converts ' into &apos;
>>
>> Hi Paul,
>>
>> Maybe you are looking for System.Web.HttpUtility.HtmlEncode() and
>> System.Web.HttpUtility.HtmlDecode() methods.
>> HTH,
>>
>> Efran Cobisi
>> http://www.cobisi.com
>>
>> Paul ten Brink wrote:
>>
>>> Hello,
>>>
>>> A web service returns a string containing an apostrophe, but it is
>>> converted to its HTML code equivalent (see subject).
>>>
>>> (I am avoiding using the actual characters, since these could be
>>>
> changed
>
>>> by mail programs/services, which could make my question very
>>>
> confusing.)
>
>>> There is a simple conversion call, but I can't remember it and
>>>
> Googling
>
>>> does not help. Something like System.Convert...
>>>
>>> Can anyone help me out?
>>>
>>> Thanks in advance,
>>> Paul ten Brink
>>> ***@philips.com
>>>
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Ian Suttle
2007-02-22 18:05:09 UTC
Permalink
Continue reading on narkive:
Loading...