Error: the type or namespace UI doesnt exist in the namespace

perlynsparks picture perlynsparks · Aug 8, 2014 · Viewed 23.4k times · Source

I need to use System.Web.UI in a class library project.

using System.Web.UI;

namespace OnlinePdViewer
{
    public class DisplayPd
    {
    }
}

I get compile error when using System.Web.UI statement:

"The type or namespace name 'UI' does not exist in the namespace in the 'System.Web' are you missing an assembly reference?"

I tried to add the reference System.Web, but COM does not include System.Web dll.

Can you help me figure out this? Thank you..

Answer

perlynsparks picture perlynsparks · Aug 11, 2014

My mistake.. I found the answer it is so easy.

Go to Menu Project --> Add Reference --> Chose Framework --> Choose System.Web dll and click OK. Error will be removed