Why is System.Web.HttpUtility.UrlEncode giving namespace name doesn't exist in Visual C# 2008?

前端 未结 4 1327

I\'m trying to encode a URL using the HttpUtility.UrlEncode() method, why am I getting

The type or namespace name \'HttpUtility\' does not e

4条回答
  •  不思量自难忘°
    2021-02-02 11:33

    You need to include a reference to System.Web. Right-click your project in the Solution Explorer and choose Add Reference... . If you take a look at MSDN you'll see it's contained in the System.Web.dll assembly, as far as I remember, this is not referenced by default in new projects.

提交回复
热议问题