Showing posts with label Sharepoint. Show all posts
Showing posts with label Sharepoint. Show all posts

Saturday, August 17, 2013

Hide the content type dropdown field in Edit Form of library



$(document).ready(function() {
        $("select[id*='ContentTypeChoice']").closest('tr').hide();
});

How to hide the Select and Deselect Check box in a List/Library in SharePoint 2010



You will see all the options for customizing the list\library. Click On the Tabular View
Here you will find that, “Allow Individual Item Checkboxes” option is selected

Wednesday, February 10, 2010

Adding Silverlight application(.xap file) in sharepoint web part.

Import the System.Web.UI.SilverlightControls to use the silverlight control.

Create the object of Silverlight control and specify the path of .xap file. Add this control in web part.

Silverlight silverlightControl = new Silverlight();
silverlightControl.ID = "DemoId";
silverlightControl.Source = "~/_layouts/1033/Demo.xap";
silverlightControl.Width = Unit.Percentage(100);
silverlightControl.Height = new Unit(400);
silverlightControl.AutoUpgrade = true;

this.Controls.Add(silverlightControl);

Monday, February 8, 2010

Bind dropdown list with sharepoint choice column as data source programmatically

Easy way to populate the dropdown list with databind option instead of looping the items in list for Choice column.

private void FillDropDownList(SPList list , DropDownList drpList , string columnName)
{
try
{
SPFieldChoice field = (SPFieldChoice)list.Fields[columnName];
drpList.DataSource = field.Choices;
drpList.DataBind();
}
catch (Exception ex)
{}
}

Thursday, January 28, 2010

Installation of Moss on Windows Server 2008 : Compatibilityi issue

We should install MOSS with SP1 on Windows Server 2008 environment to avoid the compatibility.

Access denied while updating web objects.

We get Access denied even if the code is running under 'RunWithElevatedPrivileges' and AllowUnsafeUpdates is set to True.

Solution :
Instead of using RunWithElevatedPrivileges command , create a instance of SPSite with system account user token.

SPSite currentSite = SPContext.Current.Site;

using(SPSite _oSite = new SPSite(currentSite.ID, urrentSite.SystemAccount.UserToken))
{
// Do something
}

Thursday, December 17, 2009

Use SPDisposeCheck Tool for Sharepoint Objects

SPDisposeCheck is a tool to help you to check your assemblies that use the SharePoint API so that you can build better code. It provides assistance in correctly disposing of certain SharePoint objects to help you follow published best practice. This tool may not show all memory leaks in your code.
Download SPDisposeCheck from

http://code.msdn.microsoft.com/SPDisposeCheck

Path of SpDisposeCheck in system : "c:\Program Files\Microsoft\SharePoint Dispose Check\"
Run the following command against assembly :

c:\>Spdisposecheck "Path of Assembly " >> "output filename with full path"

Best practice notes of SPDisposeCheck , refer below link:
http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx

Regards,
Shobha

Sunday, October 12, 2008

SharePoint Portal Server 2003 Migration to MOSS 2007

Steps for Database Migration :
1. Prescan the 2003 Sharepoint site or database using the following command in 12 hive directory:
Prescan /all : for all sites.
Prescan /v http://SiteUrl : For a single site.
2. Check the logs of prescan, if any errors fix it and prescan again until operation completes without errors.
3. Take the backup of database.
4. Restore the database in Sql Server 2005 at MOSS 2007 environment.
5. Create a web application in central administration (MOSS 2007).
6. Open the command prompt and change to 12 hive directory.
7. Use the stsadm –o addcontentdb Command to upgrade the database:
stsadm.exe -o addcontentdb -url -databasename [-databaseserver ] [-databaseuser ] [-databasepassword ]
It takes time(hours) to upgrade the database depends on the size of database.
That’s it, Operation completed successfully. If not check for errors in log file(Upgrade Log).
Note : SP1 should be installed at Moss 2007 environment before upgrade.