views:

242

answers:

1

I would like to URL encode a URL in a C# SSIS script task. I have tried using System.Web.HttpServerUtility, but intellisense shows it doesn't seem to be aware of "Server". Here's an example of the code that's raising an error:

Import System.Web
...
...
...
Server.HtmlEncode(TestVariable);

I have worked around this issue by writing a function that finds and replaces characters in a string to mimic HTML encoding a string, but I honestly abhore the solution. I would really just like to find out what I need to differently to use what's baked into .NET instead of reinventing the HTML Encoder wheel.

+1  A: 

You need to add a reference to the assembly System.Web

Johan Buret

related questions