Wednesday, 26 December 2012

Adding a Script Reference Dynamically Through Code


protected override void OnPreRender(EventArgs e)
{
     // Register the jQuery script from "_layouts/jQuery/jquery-1.6.js"
     ScriptLink.Register(this.Page, "jQuery/jquery-1.8.3.js", false);
     base.OnPreRender(e);
}

Friday, 21 December 2012

Sharepoint designer workflow does not start automatically

I create a work flow in sharepoint designer and publish it. I enable Automatically start this workflow when a new item is created.But when i create new item this workflow does not start automatic.

Solution:
SPD workflow will not start automatically under System Account.

If you have installed the Infrastructure update, you can change the account that associated the workflow via stsadm which will allow it to automatically start.

Or Log in to a different account and do the same operation in list. Work flow will be running fine.

Thursday, 20 December 2012

Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.


I am getting the above error, when I am  trying to deploy the web part through visual studio. The reason is the current logged-in user may not be the "db owner" in the content databases.

Solution:
To deploy the solution successfully, you need to map the current logged-in user as db_owner into the 3 databases.
1. SharePoint_Config
2. SharePoint_Admin_[GUID]
3. Your current web application that needs to deploy the Web part
To do the above open sql server.
Go to security -> Logins. Choose the user name.
Right click on it  -> Go to properties  -> click on User Mapping .

See the below image for details.


Sunday, 16 December 2012

How to Remove a User from a SharePoint 2010 Site Collection


1 - As a site collection administrator, click Site Actions –> Site Permissions.
2 - Click into any existing group (like site Owners).  The URL will be something like http://server/_layouts/people.aspx?MembershipGroupID=28.
3 - Change the 28 to a 0.  The list should now show you All People.
4 - Find the user who isn’t updating, click the checkbox by their name.
5 - Click Actions, Delete Users from Site Collection.