Showing posts with label equilant. Show all posts
Showing posts with label equilant. Show all posts

Thursday, March 22, 2012

Server.HtmlDecode for windows services (Urgent)

Hello,
does anybody knows the equilant of Server.HtmlDecode when
creating a windows service?
Thanks, SonuI think System.Web.HttpUtility.HtmlDecode, which is a static function,
should do the trick. HttpUtility is a pretty useful class for programs
which don't have access to a Server object like you do in ASP.Net
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
> Hello,
> does anybody knows the equilant of Server.HtmlDecode when
> creating a windows service?
> Thanks, Sonu
Hi Karl,
I get the following error when using this:
"HttpUtility" is not a member of "web".
Sonu

>--Original Message--
>I think System.Web.HttpUtility.HtmlDecode, which is a
static function,
>should do the trick. HttpUtility is a pretty useful
class for programs
>which don't have access to a Server object like you do in
ASP.Net
>Karl
>--
>MY ASP.Net tutorials
>http://www.openmymind.net/
>
>"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
>news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
when
>
>.
>
You don't have the System.Web.dll referenced in your project.
Unfortunately, System.dll actually has a System.Web namespace in it, which
is why the error is what it is. Simply reference System.Web.dll :)
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
news:18ba01c4bc87$fde97980$a601280a@.phx.gbl...
> Hi Karl,
> I get the following error when using this:
> "HttpUtility" is not a member of "web".
> Sonu
>
> static function,
> class for programs
> ASP.Net
> when
Hello,
I imported the System.Web via the project properties
and thought that this should be enough. But it wasnt. I
have reference System.Web and it works now. Many thanks.
Sonu

>--Original Message--
>You don't have the System.Web.dll referenced in your
project.
>Unfortunately, System.dll actually has a System.Web
namespace in it, which
>is why the error is what it is. Simply reference
System.Web.dll :)
>Karl
>--
>MY ASP.Net tutorials
>http://www.openmymind.net/
>
>"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
>news:18ba01c4bc87$fde97980$a601280a@.phx.gbl...
in
>
>.
>

Server.HtmlDecode for windows services (Urgent)

Hello,

does anybody knows the equilant of Server.HtmlDecode when
creating a windows service?

Thanks, SonuI think System.Web.HttpUtility.HtmlDecode, which is a static function,
should do the trick. HttpUtility is a pretty useful class for programs
which don't have access to a Server object like you do in ASP.Net

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
> Hello,
> does anybody knows the equilant of Server.HtmlDecode when
> creating a windows service?
> Thanks, Sonu
Hi Karl,

I get the following error when using this:

"HttpUtility" is not a member of "web".

Sonu

>--Original Message--
>I think System.Web.HttpUtility.HtmlDecode, which is a
static function,
>should do the trick. HttpUtility is a pretty useful
class for programs
>which don't have access to a Server object like you do in
ASP.Net
>Karl
>--
>MY ASP.Net tutorials
>http://www.openmymind.net/
>
>"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
>news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
>> Hello,
>>
>> does anybody knows the equilant of Server.HtmlDecode
when
>> creating a windows service?
>>
>> Thanks, Sonu
>
>.
You don't have the System.Web.dll referenced in your project.

Unfortunately, System.dll actually has a System.Web namespace in it, which
is why the error is what it is. Simply reference System.Web.dll :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
news:18ba01c4bc87$fde97980$a601280a@.phx.gbl...
> Hi Karl,
> I get the following error when using this:
> "HttpUtility" is not a member of "web".
> Sonu
>
> >--Original Message--
> >I think System.Web.HttpUtility.HtmlDecode, which is a
> static function,
> >should do the trick. HttpUtility is a pretty useful
> class for programs
> >which don't have access to a Server object like you do in
> ASP.Net
> >Karl
> >--
> >MY ASP.Net tutorials
> >http://www.openmymind.net/
> >"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
> >news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
> >> Hello,
> >>
> >> does anybody knows the equilant of Server.HtmlDecode
> when
> >> creating a windows service?
> >>
> >> Thanks, Sonu
> >.
Hello,

I imported the System.Web via the project properties
and thought that this should be enough. But it wasnt. I
have reference System.Web and it works now. Many thanks.

Sonu

>--Original Message--
>You don't have the System.Web.dll referenced in your
project.
>Unfortunately, System.dll actually has a System.Web
namespace in it, which
>is why the error is what it is. Simply reference
System.Web.dll :)
>Karl
>--
>MY ASP.Net tutorials
>http://www.openmymind.net/
>
>"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
>news:18ba01c4bc87$fde97980$a601280a@.phx.gbl...
>> Hi Karl,
>>
>> I get the following error when using this:
>>
>> "HttpUtility" is not a member of "web".
>>
>> Sonu
>>
>>
>> >--Original Message--
>> >I think System.Web.HttpUtility.HtmlDecode, which is a
>> static function,
>> >should do the trick. HttpUtility is a pretty useful
>> class for programs
>> >which don't have access to a Server object like you do
in
>> ASP.Net
>>> >Karl
>>> >--
>> >MY ASP.Net tutorials
>> >http://www.openmymind.net/
>>>> >"Sonu Kapoor" <sonukapoor@.gmail.com> wrote in message
>> >news:18a401c4bc81$7f99de90$a601280a@.phx.gbl...
>> >> Hello,
>> >>
>> >> does anybody knows the equilant of Server.HtmlDecode
>> when
>> >> creating a windows service?
>> >>
>> >> Thanks, Sonu
>>>> >.
>>
>.

Server.HtmlDecode for windows services

Hello,

does anybody knows the equilant of Server.HtmlDecode when creating a windows service?

Thanks, SonuHave you tried setting a reference to System.Web and doing:


string decoded = System.Web.HttpContext.Current.Server.HtmlDecode(encodedString);

When using this I get:

"HttpContext" is not a member of "web".

Sonu
uups...sorry I forgot to add the reference. It works now.

Sonu