Solved

Server.UrlEncode syntax not regoznized by compiler

Posted on 2008-06-17
2
264 Views
Last Modified: 2010-04-15
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?
0
Comment
Question by:dba123
2 Comments
 
LVL 18

Expert Comment

by:jcoehoorn
ID: 21806636
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.
0
 
LVL 16

Accepted Solution

by:
burakiewicz earned 500 total points
ID: 21807118
add a reference in your project to System.Web. then use
HttpUtility.UrlDecode();
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now