<%@ Page Language="VB" %>
<%@ Import Namespace="System.DirectoryService" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="WebPartPageExpansion" content="full" />
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
.style1 {
text-align: center;
}
.style2 {
text-align: left;
}
</style>
</head>
<body>
<script type="text/vb" runat="server">
Private Sub PopulateGrid()
Dim dListing As DirectoryEntry = GetListing()
End Function
I am getting "DIrectoryEntry is not defined". I assume this is because I need to add a reference. I normally develop in Visual Studio, and would go "Project > Reference > Select Component", and then import the namespace. I figure I have to do the same thing
here, but I have no idea how. I am using Sharepoint Designer to create a single ASP page.
Warning: BC40056: Namespace or type specified in the Imports 'System.DirectoryService' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Source Error:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\77af5d62\8d9d3330\App_Web_15_63a4413b-9b82-46e0-8377-2f9fb64c70b8_-573700.rmssqttv.0.vb
Line 20: Imports System.Configuration
Line 21: Imports System.Data.SqlClient
Line 22: Imports System.DirectoryService
Line 23: Imports System.Linq
Line 24: Imports System.Text
We could import a namespace into a Web page via <%@ Import namespace="value" %>, but “DirectoryService” is not in
System namespace. Please make sure if you include required dll file in your project.
tmontney
I am getting "DIrectoryEntry is not defined". I assume this is because I need to add a reference. I normally develop in Visual Studio, and would go "Project > Reference > Select Component", and then import the namespace. I figure I have to do the same thing
here, but I have no idea how. I am using Sharepoint Designer to create a single ASP page.
You could try to copy the dll file into your bin folder and try it again.
Best Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
None
0 Points
1 Post
How to import a namespace
Nov 06, 2015 12:42 PM|tmontney|LINK
I am getting "DIrectoryEntry is not defined". I assume this is because I need to add a reference. I normally develop in Visual Studio, and would go "Project > Reference > Select Component", and then import the namespace. I figure I have to do the same thing here, but I have no idea how. I am using Sharepoint Designer to create a single ASP page.
All-Star
40565 Points
6233 Posts
Microsoft
Re: How to import a namespace
Nov 09, 2015 12:13 AM|Fei Han - MSFT|LINK
Hi tmontney,
Welcome to ASP.NET forum.
We could import a namespace into a Web page via <%@ Import namespace="value" %>, but “DirectoryService” is not in System namespace. Please make sure if you include required dll file in your project.
You could try to copy the dll file into your bin folder and try it again.
Best Regards,
Fei Han