Monthly Archives: May 2008

Sharepoint webpart property sample


showing a sample of a webpart property used in sharepoint   using System.Web.UI.WebControls.WebParts; using Microsoft.SharePoint.WebPartPages; using System.ComponentModel;   private const string str_webpart_category = "My webpart settings"; private string _str_property = string.Empty;   [WebBrowsable(true), Category(str_webpart_category), DefaultValue(""), WebPartStorage(Storage.Shared), FriendlyName("Property name:"), Description("Description of this … Continue reading

Posted in Sharepoint 2007 | Leave a comment

Get sharepoint list template name by sharepoint list template internal name


i was looking for the listtemplates, but my sharepoint was in dutch so i could not use the listtemplates displayname, i had to get the displayname by internal name before i could use that template   public static string GetListTemplateNameByListTemplateInternalName(string … Continue reading

Posted in Sharepoint 2007 | Leave a comment

Get/Show all sharepoint list templates


  this will show all the sharepoint list templates it will show the displayname in any language and the internalname is the english origenal name.   //using Microsoft.Sharepoint public static void ShowAllListTemplates() {      try      {           foreach (SPListTemplate … Continue reading

Posted in Sharepoint 2007 | Leave a comment

Add object to sharepoint list


  before i made the function that could take an object and convert it into a SP list now i made this function to fill that list with the same object based on its properties   public static void AddObjectToSPList(object … Continue reading

Posted in Sharepoint 2007 | Leave a comment

Get object property value by name


this is how u can get a property value from an object property by name   using System.Reflection;   public static object GetObjectPropertyValue(object o_object, string str_property_name) {      object o_value = null;      try      {           if (o_object != … Continue reading

Posted in C# | Leave a comment

How to show/get all the fields of the current file


  this will return a string containing all SPfile fields it will show the Displayname of the field and the internalname   public static string ShowCurrentFileFields() {      StringBuilder sb = new StringBuilder();      SPFile file = SPContext.Current.File;      if … Continue reading

Posted in Sharepoint 2007 | Leave a comment

Sharepoint delegate controls


The out-of-the-box default.master defines these delegate controls for you to override:   AdditionalPageHead GlobalSiteLink0 GlobalSiteLink1 GlobalSiteLink2 SmallSearchInputBox TopNavigationDataSource PublishingConsole QuickLaunchDataSource Of these, only the AdditionalPageHead is set to allow multiple controls. Notice that PublishingConsole is defined, which is true even … Continue reading

Posted in Sharepoint 2007 | Leave a comment