Archive for March 12, 2012

SharePoint custom Master Page Do Not Print


Issue: When using Microsoft custom Master Pages, print preview pages dont show any content in the body of the page. Reason: Sharepoint use core.css file in which they write few classes where they says that this class should not be use for print/media. Solution:- While customizing make sure not to use those classes on top […]

March 12, 2012 · Infoyen · No Comments
Tags: , , , , ,  · Posted in: Branding, MOSS, SharePoint

Retrieve Web part Title in Contentquerymain.xsl


To retrieve webpart title in Contentquerymain.xsl, You can use Feed Title web part property. To achieve this you need to add <xsl:param name=”FeedTitle” /> to your custom ContentQueryMain.xsl in the params section. Doing this the param FeedTitle will contain the web part Title and can be used inside xsl as below code <xsl:value-of select=”$FeedTitle” /> […]

March 12, 2012 · Infoyen · 7 Comments
Tags: , , , ,  · Posted in: CQWP, MOSS, SharePoint

Creating a List programmatically using the sharepoint object model


You can create a list by picking one of the List Template Types available in the SPListTemplateType object. Guid listId = web.Lists.Add(“List Name”, “Description”, SPListTemplateType.GenericList); SPList list = web.Lists[listId]; Reference: http://msdn.microsoft.com/en-us/library/ms425818.aspx http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype.aspx Thanks! Avinash

March 12, 2012 · Infoyen · No Comments
Tags: , ,  · Posted in: List, MOSS, SharePoint

Programmatically adding items to a SharePoint list


using(SPSite site = new SPSite(“http://”)) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists[“SharePointList”]; // you can use web.GetList method which is better for performance. SPListItem Item = list.Items.Add(); item[“Title”] = txtCompanyName.Text; // the text which need to update //can add required items  item.Update(); } } Note: 1. No need to use SPSecurity.RunWithElevatedPrivileges. […]

March 12, 2012 · Infoyen · One Comment
Tags: , , , ,  · Posted in: List, MOSS, SharePoint

Document Icon in CQWP


Description This article will show you how to display icon in Content Query Web Part (CQWP). Requirement:- In several requirements we use existing CQWP and modify XSLT to make required view. In one of requirement i asked to display icon of uploaded document. I found the very simple solution for which detail is described further […]

March 12, 2012 · Infoyen · No Comments
Tags: , , , ,  · Posted in: CQWP, MOSS, SharePoint


myworldmaps infoyen