thankgodfortektips
Programmer
Hi all,
I am trying to automatically create a document library in Sharepoint. I have been given the below code and been told that it will work once the microsoft.sharepoint.dll file is put in the assembly folder.
It is on Server03 with IIS 6.
I have the following code...
********************************************************
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%
Dim url As String
url = "Dim site As New SPSite(url)
Dim web As New SPWeb
web = site.OpenWeb()
Dim g As Guid
g = web.Lists.Add("MWMH", "MWMHDescription", SPListTemplateType.DocumentLibrary)
%>
<html>
<head>
<title>Create Doc Lib</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
*********************************************************
which is giving me the following error:
*********************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'SPSite' is not defined.
Source Error:
Line 4: Dim url As String
Line 5: url = "Line 6: Dim site As New SPSite(url)
Line 7: Dim web As New SPWeb
Line 8: web = site.OpenWeb()
***********************************************************
Thanks in advance guys!!!
I am trying to automatically create a document library in Sharepoint. I have been given the below code and been told that it will work once the microsoft.sharepoint.dll file is put in the assembly folder.
It is on Server03 with IIS 6.
I have the following code...
********************************************************
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%
Dim url As String
url = "Dim site As New SPSite(url)
Dim web As New SPWeb
web = site.OpenWeb()
Dim g As Guid
g = web.Lists.Add("MWMH", "MWMHDescription", SPListTemplateType.DocumentLibrary)
%>
<html>
<head>
<title>Create Doc Lib</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
*********************************************************
which is giving me the following error:
*********************************************************
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'SPSite' is not defined.
Source Error:
Line 4: Dim url As String
Line 5: url = "Line 6: Dim site As New SPSite(url)
Line 7: Dim web As New SPWeb
Line 8: web = site.OpenWeb()
***********************************************************
Thanks in advance guys!!!