In Focus
C# Corner Mumbai Chapter: Learn Windows Presentation Foundation (WPF) with CMUG
Jabalpur Chapter Meet July 13: Register Now
Chandigarh Chapter: Developers Day on 29 June 2013
Delhi Chapter Hands On June 22: Limited Seats Register Now
Email :
Password :
Remember me?
Forgot password
Contribute
An Article
A Blog
A News
A Video
A Link
An Interview Question
Ask a Question
TECHNOLOGIES
.NET 4.5
Chapters
JavaScript, CSS
SharePoint 2010
Web Development
.NET Assemblies
Coding Best Practices
JQuery
SharePoint 2013
Web Services in C#
ADO.NET in C#
Current Affairs
JSP
Silverlight with C#
Windows 8
AJAX in C#
Databases & DBA
Leadership
Smart Devices
Windows Azure
Android Programming
Design & Architecture
Learn .NET
SQL
Windows Controls C#
Articles C#
Exception Handling C#
LightSwitch 2012
SQL Server 2012
Windows Forms C#
ASP.NET Controls in C#
Expression Studio
LINQ
Testing
Windows Phone 8
ASP.NET MVC with C#
Graphics Design
Mobile & Embedded
TypeScript
Windows Server 2012
ASP.NET Programming
How do I
Office 2013
Visual C#
Windows Store Apps
BizTalk Server
HTML 5
OOP/OOD
Visual Studio .NET
Workflow Foundation in C#
C# Language
Internet & Web
Operating Systems
Visual Studio 2010
WPF
C# Tutorials
iPhone/iPad
PHP
Visual Studio 2012
XAML
C, C++, MFC
Java
Products
WCF with C#
XML
Career Advice
Java and .NET
Project Management
Request a new Category
|
View All
ANSWERS
BLOGS
VIDEOS
INTERVIEWS
BOOKS
LINKS
NEWS
CHAPTERS
CAREER ADVICE
Simple Tooltip Using HTML and CSS
Kolkata Chapter Developer Day Official Recap
Object Oriented Programming Using C#: Part 9
JsAction with T4 Template
Logging Using Log4net in Compact Framework 2 ...
Learn OOP Interface Using C#
S.O.L.I.D Principle Inversion of Control and ...
How To Find A Doctor Near Your Home in SQL S ...
Creating Simple MVVM Application With Data B ...
How to Add an Alias (CNAME) Resource Record ...
ARTICLE
8
9,859
Programmatically enable Enterprise keywords in SharePoint 2010
Posted by
Vijai Anand
in
Articles
|
SharePoint 2010
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
4192
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
This Feature is Sponsored By
Make Your Data Do More with the Ignite UI Grid. Launch eye-popping, performance-driven HTML5 apps w/ Ignite UI's free jQuery Grid.
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
Enable Enterprise keywords in SharePoint 2010 using powershell
Tags:
Enable Enterprise keywords in SharePoint 2010 using powershell
,
Enable Enterprise keywords in SharePoint using powershell
,
how to Enable Enterprise keywords using powersheel
,
how to Enable Enterprise keywords
Related Articles
Enable Enterprise keywords in SharePoint 2010 using powershell
Unable to View the Enterprise Keywords in SharePoint 2010 Lists
Configure Metadata publishing in SharePoint 2010
Enterprise Keywords in SharePoint 2010
How to Create an Enterprise Search Center 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
How to enable and disable SharePoint 2010 rating programmatically
Programmatically get all the Social Tags for the Specified User in SharePoint 2010
Configure a Crawl Schedule for Enterprise Search Content Source in SharePoint 2010
comments
View Previous Comments
of
COMMENT USING
PREMIUM SPONSORS
Infragistics
Infragistics is experts in technology and design, and passionate about helping you build highly performant and stylish applications that solve problems, deliver inspiration, and maximize results.
TRENDING UP
Simple Tooltip Using HTML and CSS
Kolkata Chapter Developer Day Official Recap
Object Oriented Programming Using C#: Part 9
JsAction with T4 Template
Logging Using Log4net in Compact Framework 2.0 in Visual Studio 2008
Learn OOP Interface Using C#
S.O.L.I.D Principle Inversion of Control and Resolution With Dependency Injection
How To Find A Doctor Near Your Home in SQL Server
Creating Simple MVVM Application With Data Binding
How to Add an Alias (CNAME) Resource Record to a Zone
View All
MOST LIKED ARTICLE
WCF Introduction and Contracts - Day 1
Create SSRS Report Using Report Wizard
CREATE READ UPDATE and DELETE - CRUD Operation Using LINQ to SQL
WCF - Data Contract - Day 4
Factory Design Pattern
Follow @twitterapi
HOT KEYWORDS
Client object model
Dashboard
menu
MOSS 2007
Object Model
Power Shell
PowerShell
PowerShell script
properties
RBS
RSS
share point
SharePoint 2007
SharePoint 2010
sharepoint 2010 tutorials
sharepoint articles
SharePoint Designer
sharepoint foundation server
sharepoint list
SharePoint Server 2010
sharepoint tutorials
User
VS 2010
VS2010
webpart
SPONSORED BY
Download Your Free HTML5/jQuery Grid Now!
Make Your Data Do More with the Ignite UI Grid. Launch eye-popping, performance-driven HTML5 apps w/ Ignite UI's free jQuery Grid.
My Facebook Friends
WHITEPAPERS AND BOOKS
Interview Questions on SharePoint 2013
SharePoint 2010 Administration & Development
Getting Started with Managed Metadata Service in SharePoint 2010
Windows Phone 7 Hileleri
Windows Phone Development Step by Step Tutorial
Essentials of SharePoint 2010: Business Intelligence Capabilities
Working with Directories in C#
FileInfo in C#
Programming List with C#
Source Code: Graphics Programming with GDI+
View All
Poll
Result
All Polls
Speed of C# Corner
How do you find speed of C# Corner when visiting the site?
Very Fast
OK
Slow
Very Slow
How do you find speed of C# Corner when visiting the site?
Options
Votes
%
Very Fast
4
6.90
OK
47
81.03
Slow
4
6.90
Very Slow
3
5.17
Total
58
100%