HttpUtility.UrlEncode in visual basic.net

pvg1975
pvg1975 used Ask the Experts™
on
Hi all,

I need to do this on a visual basic.net project:

HttpUtility.UrlEncode(field.Value)

I already imported system.net but I sitll get the error:

httputility is not declared.

Any suggestions?

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
Add a reference to System.Web.dll.

Author

Commented:
I get an error when I add:

Imports System.Web.dll

I added as

Imports System.Web

but still the same
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
That's not adding a reference. I am referring to navigating to:  Project->Add Reference. Once you do that, then try to add the imports statement:

    Imports System.Web
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:

Author

Commented:
Yes, I figured that out later :P

I added the refecence and the error is gone, but I get this warning message:

Warning      1      Possible problem detected while building assembly 'Project1': Referenced assembly 'System.Web.dll' targets a different processor      'Project1

Author

Commented:
ITs working, even with the warning message. Thanks!!!
kaufmedGlanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015

Commented:
I haven't ran into that myself, but from what I read, it just means that you are most likely targeting x64, but the System.Web library you referenced is x86. The warning should not affect compilation.

Glad to help  = )

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial