Namespace is found in class, but not in aspx

Viewed 1104

I'm having trouble with the namespace System.Net.Http.

I want to use, e.g. HttpClient, from the namespace System.Net.Http. When I use using System.Net.Http; in a C# class, I can use HttpClient just fine, but when I try to import the namespace in an aspx file, like this: %@ Import Namespace="System.Net.Http" %> it won't regonize HttpClient:

The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?)

I've already installed it like this and added it to my references by doing this.

How do I use, e.g. HttpClient, in my .aspx file like I use it in a C# class?

UPDATE

This is not a duplicate of Why should i include the namespace in each aspx page?, because I'm not asking how I'm supposed to include a namespace in every class.

1 Answers
Related