Monday, March 21, 2011

Error:Share Point Timer Service Not Activated

Hi all, i got an exception like "service timer not started......." while activating a web part feature to a site in share point. In share point all the operations run on a service timer, That's why i am not able to move single inch forward from that state. After googling for some...

Get The Input values from web part editor part in share point 2007

In SharePoint Portal Server 2003, which called its reusable widgets WebParts. Thus, it makes perfect sense that ASP.NET 2.0 provides fantastic support for WebParts, and it definitely is no surprise to see Microsoft Office SharePoint Server 2007 (MOSS 2007) built upon this very framework....

Add Fields to list in share point through coding.

In share point lists we have the fields. We can add the fields to list though administration. Here is the code to add the fields to list through coding. /// Add a field to the list private static void AddFieldToList(SPList list) { string fieldName = string.Empty; Console.WriteLine("enter the name of the field to add"); ...

Monday, February 28, 2011

Change the default view of a list programmatically in share point

Every list in share point has a view to display the contents. We can change or we can create the new view through UI. we can also change the default list view through coding also.the below code shows how to change the default view of a list. //Change the default list view of a string in share point private static void ChangeListDefaultView(SPList list) { ...

Display Created and modified details of a list item in share point through coding.

In share point the list item will store the details of the created and modified details of the user by using the user credentials details. It will store as "number#user name" format.here the number is a system defined key to get the user details while using the people picker. So we need to eliminate the number and display only the user name. The details are stored internally created...

Add attachment to a list in share point

In share point we can upload the documents to the document library. this will be possible through the UI and through coding also. The below code shows how to add the documents to a list. //Add attachments to document library. private static void AddItemsToDocumentLibrary(SPWeb currentWeb) { string fileName = string.Empty; long fileStreamLength; ...

Sunday, February 27, 2011

Hide content types of a list in share point programmatically.(Hide the content types in new button drop down in the share point list)

In share point list contains the content types. The available content types will be available on the new button drop down list. Programmatically we can hide the content types available in the list. The code shown shown below. //hide the content types of a list in the new button drop down list private static void HideContentType(SPList list) { string contentTypeName = string.Empty; ...

Delete content types in share point list (Remove the options under the new button dropdown in share point list)

In my previous post i was published how to add the content types to a list in share point. It is also possible to delete the content types in the share point lists. The following code deletes the required content types in the list. //delete content types from a list private static void DeleteContentType(SPWeb currentWeb) { string listTitle = string.Empty; SPList currentList; ...

Add Content type to a list in share point (Show content types under new button drop down for a list)

In the list we have new option in the menu.By using that new button we will generate the new item. Recently i have a requirement that to add new content types to all the websites in the site. It will take lot of time to go through ui. Programatically it will become easy to update the all the lists in the web. This is the code to add the list contents in share point lists //add...

Display permissions assigned to a list programmatically

In my prevoius post explained how to display the views that assigned to a list. By that you can get the views assigned to a perticular list. then what about the permissions assigned to a list. Share point people also described a class for permissions as SPPermissions. But later they extended the SPPermissions class and they deprecated SPPermissions class. But still it is available...

Saturday, February 26, 2011

Display list views in sharepoint programmatically

In Share point each list has own view and through that the user can get the information as per his required view. We can add the views and delete the views in share point. Through program we can get what are the views available in the list. By using the following code we can get the views available in the list // Get the list the list and display the views...

SharePoint - Delete and update list items programmatically and Collection modified Exception

In One of my exercise there is a requirement to delete the list items in SharePoint programmatically. For that we need to search the entire list item collection in the list.By Deleting the item in the list we need to break the loop. Because in the SharePoint the collection will be reloaded in the memory, and the list collection is not available for looping....

SharePoint - Adding list Items Programmatically

Every list the SharePoint has list items. SPListItemCollection object is used to get the all list items in SharePoint .SPListItem is the class is used to store the list items. We can do the operations on list items through coding in SharePoint. code snippet to Add the list items to list in SharePoint. // Get The Lists in the site and add the items...

Show list details in SharePoint

In SharePoint the lists and libraries are main parts. To get the list details regarding the list title and the list description there are predefined properties are created by the the SharePoint developers. I was implemented the following code in visual studio console application before using that you need to have the SharePoint  reference. You can get...

Friday, February 25, 2011

asp page lifecycle

ASP.NET Page Life Cycle Overview When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running...