SharePoint - Managing (Save & Delete) List Templates programmatically in SharePoint

Asked By eliza sahoo
09-Feb-10 07:30 AM
List templates are predefined layouts available in SharePoint which can be used to create new content quickly and easily .The List templates are maintained within the site collection List template gallery. Sharepoint provides OOTB functionality to create and delete list templates. Below mentioned are ways to Save a list as List Template and deleting a list template from the List Template Gallery programmatically.
 
 
Saving a List Template
 
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite oSPsite = newSPSite("http://myserver/site"))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{
SPList lstSource = oSPWeb.Lists["SourceList"];
lstSource.SaveAsTemplate("FileName.stp","Name""Description"false);
lstSource.Update();
}
}
}); //end elivated privileges

http://www.mindfiresolutions.com/
  Alon Havivi replied to eliza sahoo
09-Feb-10 02:01 PM
Again, thanks for the sample... remember it's better to publish your knowledge base on the FAQ section.
Create New Account
help
using Office 2007 with Sharepoint SharePoint My company usese MOSS 2007 and we recently set up Sharepoint for a number of business processes. As part of policy, the technology area has banned the use of Office 2007 to access lists in Sharepoint. The fear is that, for example, one would use access a very large list through scenarios, but the scenarios are unknown. They have also banned the use of Infopath and Sharepoint. What can I do to mitigate any risks posed by using Office 2007 and Sharepoint? What are the risks? SharePoint Discussions SharePoint (1) Office 2007 (1) MOSS 2007 (1) Infopath (1) Argniw (1) Idiots (1) Usese (1
Drag an inbox email into a Sharepoint Doc Library visible in Outlook Folder List under "Sharepoint Lists" SharePoint If I connect a Sharepoint doc library to Outlook, the library appears in my Outlook Folders list like this: Sharepoint Lists \ Sharepoint Library Name (files in that Sharepoint LIbrary appear here) (Subfoldes in that Sharepoint Library appear here) If I then select an email from my inbox, and drag it
Coding sharepoint SharePoint I would like to Customize Sharepoint by .NET C# Code. Am I correct in thinking the only way to do this a web part? Also, is it also correct to say you need to have administrator privileges to add your custom webpart into the SharePoint system? -Yin SharePoint Design Discussions SharePoint (1) SharePoin (1) YinAs (1) Michelangelo (1) Gannt (1) Yin (1) Javascript (1) Profiles (1 is too low and we reach it" (c) Michelangelo Y> I would like to Customize Sharepoint by .NET C# Code. Y> Y> Am I correct in thinking the only way to
RSA and Sharepoint SharePoint I'm having a problem with RSA security and Sharepoint 2007. Looks like lots of people are. Anyone making any headway? In a nutshell, we need RSA to work with Windows Authentication and MOSS 2007 Standard Edition. SharePoint Setup Discussions SharePoint (1) MOSS 2007 (1) App Pool (1) IIS (1) SecurID (1) WebID (1) Directory (1 running. Thanks. In IIS Manager -> <SERVER> -> Web Sites -> Default Web Site (or whatever you called SharePoint, expand this node. Under each Virtual Directory as well as the Application, right click and can get this up and running. The FBA should have been set up in the SharePoint config, so if you are using anon or if you are using a shared credential for the architect. When you say the "FBA should have been set up in the Sharepoint config", it was my understanding that you weren't using forms based authentication in the
How do I automate document uploads to SharePoint? SharePoint I'm wanting to use a batch file or code in MS access to copy files from a shared directory into my sharePoint documents folder. I can't seem to get this to work b / c it is a web folder and not a normal network share. Any ideass? SharePoint Design Discussions SharePoint (1) I am not sure what diificulties you are running into because you can map a drive letter to a sharepoint site without any issues. Perhaps if you posted the error message we can help. There is a tool out there call DavCopy that allows you to copy files to sharepoint. Check it out: http: / / www.bluedoglimited.com / Downloads / pages / DavCopy.aspx Well, This apparently has I'm misunderstanding something here. Using Windows, what happens when you attempt to access your SharePoint environment via a UNC? For example, do a Start and then click Run and type