SIGN UP
MEMBER LOGIN:
TECHNOLOGIES
.NET 4.5
.NET Remoting in C#
Active Directory C#
ADO.NET in C#
AJAX in C#
Algorithms in C#
Android Programming
Articles C#
ASP, JavaScript, CSS
ASP.NET Controls in C#
ASP.NET MVC with C#
ASP.NET Programming
BizTalk Server
C# Assemblies
C# Language
C# Tutorials
C, C++, MFC
Career Advice
Chapters
Cloud Computing
COBOL.NET
Coding Best Practices
COM Interop
Compact Framework
Cryptography C#
Crystal Reports C#
Current Affairs
Custom Controls C#
Databases & DBA
Deployment
Design & Architecture
DirectX C#
Enterprise Development
Error Zone
Exception Handling C#
Expression Studio
F#
Files, Directories in C#
Financial Applications
Games Programming C#
GDI+ & Graphics
Hardware
How do I
HTML 5
Internet & Web
iPhone/iPad
Java
Java and .NET
JQuery
JSP
Leadership
Learn .NET
LINQ with C#
Metro Style Apps in C#
Mobile & Embedded
MonoDevelop
MSMQ in C#
Multithreading in C#
Networking
Office Development
OOP/OOD
Operating Systems
PHP
Printing in C#
Products
Project Management
Reports using C#
Robotics & Hardware
Security in .NET
SharePoint
Silverlight with C#
Smart Devices
Speech in C#
SQL
SQL Server 2012
String in C#
Team Foundation & VSS
Testing
Visual Basic .NET
Visual C#
Visual Studio .NET
Visual Studio 11
Visual Studio 2010
VS LightSwitch 2011
WCF with C#
Web Forms C#
Web Services in C#
WebForms Controls
Windows 8 in C#
Windows Controls C#
Windows Forms C#
Windows Phone in C#
Windows PowerShell
Windows Services in C#
Workflow Foundation in C#
WPF with C#
XAML with C#
XML in C#
XNA with C#
FORUMS
BLOGS
VIDEOS
INTERVIEWS
CERTIFICATIONS
DOWNLOADS
BOOKS
LINKS
NEWS
Learn .NET in 60 days – Part 1 (13 Labs)
Learn MVC (Model view controller) Step by Step ...
Learn C# Corner - Home
Using Border Radius and Gradients in CSS3: Part I
Learn C# Corner - Footer
iPhone 5 First Look
Learn .NET and C# in 60 Days Lab13(Day 5): - C ...
Samsung Galaxy Note Review
WCF - Authentication and Authorization in Ente ...
How to write a good article on C# Corner
ARTICLE
Programmatically enable Enterprise keywords in SharePoint 2010
Posted by
Vijai Anand
in
Articles
|
SharePoint
on
June 03, 2011
Tags:
enable Enterprise keywords
,
enable Enterprise keywords in SharePoint
,
enable Enterprise keywords in SharePoint 2010
,
Enterprise keywords
,
how to enable Enterprise keywords
,
how to enable Enterprise keywords in SharePoint
,
how to enable Enterprise keywords in SharePoint 2010
In this article we will be seeing how to enable Enterprise keywords for a list using SharePoint object model.
Tweet
1971
0
0
Reader Level:
Introduction:
Enterprise keywords are used to tag the documents when uploading the documents in the document library. Enterprise documents can be enabled in both SharePoint lists and libraries. Enterprise keywords - Terms are stored in a non-hierarchical way and available for users to key in which is known as folksonomy (free tagging). In this article we will be seeing how to enable Enterprise keywords for a list using SharePoint object model.
Prerequisites:
Managed metadata service application should be configured.
Web application should be associated to the Managed Metadata Service Application.
Programmatically Enable Enterprise Keywords:
To enable Enterprise keywords through UI refer
http://www.c-sharpcorner.com/UploadFile/anavijai/7633
.
To enable enterprise keywords using object model do the following steps:
Open Visual Studio 2010.
Go to File => New => Project.
Select Console Application template from the installed templates.
Add the following references.
Microsoft.SharePoint
Add the following namespaces.
using Microsoft.SharePoint;
Replace Program.cs with the following code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
namespace EnterpriseKeywords
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://serverName:22222/sites/Test/"))
{
using (SPWeb web = site.OpenWeb("BL"))
{
SPList list = web.Lists.TryGetList("dl");
if (list != null)
{
SPField field = list.ParentWeb.AvailableFields["Enterprise Keywords"];
if (!list.Fields.ContainsField("Enterprise Keywords"))
{
list.Fields.Add(field);
list.Update();
Console.WriteLine(field.Title + " added successfully to the list");
}
else
{
Console.WriteLine(field.Title + " column already exists in the list");
}
}
else
{
Console.WriteLine(list.Title + " does not exists in the site");
}
Console.ReadLine();
}
}
}
}
}
Build the solution.
Hit F5.
Go to the =>Permissions and Management => Enterprise Metadata and Keywords Settings.
You could see the "Enterprise Keywords" enabled.
Login
to add your contents and source code to this article
share this article :
Programmatically enable Enterprise keywords in SharePoint 2010
Tags:
enable Enterprise keywords
,
enable Enterprise keywords in SharePoint
,
enable Enterprise keywords in SharePoint 2010
,
Enterprise keywords
,
how to enable Enterprise keywords
,
how to enable Enterprise keywords in SharePoint
,
how to enable Enterprise keywords in SharePoint 2010
Tags and Notes in SharePoint 2010
Tags:
.net
,
Activate SocialRibbonControl in sharepoint
,
C#
,
notes in sharepoint 2010
,
sharepoint artivles
,
Tags and Notes in SharePoint 2010
,
Tags in SharePoint 2010
,
tutorials
,
VS 2010
Related Articles
Enable Enterprise keywords in SharePoint 2010 using powershell
Configure Metadata publishing in SharePoint 2010
Enterprise Keywords in SharePoint 2010
Enable Item Scheduling in SharePoint 2010
Get the list of holds for the specified item using Powershell and programmatically in SharePoint 2010
post comment
TOP LEADERS
View All
TRENDING UP
Learn MVC (Model view controller) Step by Step in 7 days – Day 3
Learn C# Corner - Home
Using Border Radius and Gradients in CSS3: Part I
Learn C# Corner - Footer
Learn .NET and C# in 60 Days Lab13(Day 5): - Classes and objects
iPhone 5 First Look
Samsung Galaxy Note Review
WCF - Authentication and Authorization in Enterprise Architecting
How to write a good article on C# Corner
How to Display Data in ListBox From SQL Database in ASP.NET
View All
Sponsored by
Become a Sponsor
MOST LIKED ARTICLE
Learn .NET in 60 days – Part 1 (13 Labs)
Working with ProgressBar in C#
Resizable TextBox in ASP.NET using AjaxControlToolKit
Word Processing with an Extended Rich Text Box Control
Notepad in C#
TAG CLOUD
.NET
ADO.NET
app_themes
ASP.NET
C
C#
Database
Datagrid
Design
DirectoryServices
games
GridView
Images
jquery
MVC
Silverlight
Silverlight 5
Thread
try
tutorials
VB.NET
WCF
Windows Forms
WPF
XML
PREMIUM SPONSORS
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites -
Click Here
!
LATEST JOBS
Applying for job
Metro Style App Developer
.NET Developer WPF or Silverlight exp Boston MA
ASP .Net Developers
Split Testing Designer
.NET Developer
Web Developer
Application Engineer Expert
.NET Developer
Application Developer
View All Jobs
|
Post a New Job
Sponsored by
Become a Sponsor
WHITEPAPERS AND BOOKS
Essentials of Capacity Planning: Microsoft SharePoint Server 2010
Chapter 15: Customizing the Display
Chapter 9: OpenType Font Support
Successfirmations: Think, Reveal, Receive
SharePoint Designer 2010 Essentials
Building Standalone Data-Driven Applications using SQL Server Compact 4.0
Programming XML with C#
Reporting with Reports Viewer in Visual Studio 2005
Programming C# for Beginners
Programming Windows Common Dialogs with Visual C# 2010
View All