Search code examples
c#asp.netvisual-studio-2013namespacessystem.web.ui.webcontrols

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


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.


Solution

    1. Select the 'Project' menu option
    2. Select 'Add Reference'
    3. Select 'Framework'
    4. Find and check the checkbox next to the 'System.Web' DLL and select OK.

    The error will be removed.