Friday 19 February 2010



How to increase the maximum file upload size in SharePoint 2007?


1. Go to Central Administration.

2. Under the "Application Management" tab click the "Web application general settings".



3. Change the web application if the selected one is not the one you want.

4. Change the "Maximum Upload Size" as you want. The default is 50MB. Maximum is 2GB.


5. Click OK.

Thursday 28 January 2010

Display a SharePoint list in quick launch - programatically

How to display a SharePoint list in quick launch programatically?

Below I have pasted the code I used to achieve this. This code is for a document library. But the methodology is same for a list as well (since a document library is also a list).

using (SPSite siteCollection = new SPSite(http://server:3000/sites/site1))
{
using (SPWeb webSite = siteCollection.OpenWeb())
{
try
{
Guid docLibGuid = webSite.Lists.Add("Document Library 1", "Document library", SPListTemplateType.DocumentLibrary);
SPList documentLibrary = webSite.Lists[docLibGuid];
documentLibrary.OnQuickLaunch = true;

documentLibrary.Update();
}
catch (Exception ex)
{
EventLog.WriteEntry(ex.Message);
}
}
}


But I observed that if I use the code in green colour in this manner it doesn't work.

webSite.Lists[docLibGuid].OnQuickLaunch = true;
webSite.Lists[docLibGuid].Update();


It's strange....