Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

Server.UrlEncode syntax not regoznized by compiler

I'm coding in the .NET 3.5 framework.  I have included the using for System.Web.

When I try the following statement it tries to suggest the namespace Microsoft.SQLServer.Server instead when I mouse over Server.

Server.UrlEncode(myURL);

I try this but it also does not recognize "Server"

System.Web.Server.UrlEncode(myURL);

The System.Web assembly is obviously included in this non-web project also...so what the heck?
Avatar of Joel Coehoorn
Joel Coehoorn
Flag of United States of America image

Not all .Net base assemblies are referenced in every .Net project by default.  Web projects don't reference System.Windows.Forms, for example.  You can add the references you need manually just like you add references to other assemblies.
ASKER CERTIFIED SOLUTION
Avatar of burakiewicz
burakiewicz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial