Currently Browsing: Sharepoint

SharePoint Error: “The language-neutral solution package was not found”

Last night while developing an event listener custom list, I ran into this error,

SharePoint Error: “The language-neutral solution package was not found”

The solution to this problem is, Restart your visual studio. And it will be back to normal.

Hope this helps :)

tags: , , ,

Set Item level permission in sharepoint through coding

Here is the way we can add item level permission for a user on an item,
SPRoleDefinition oUserRole;
SPRoleAssignment oUserRoleAssignment;
SPListItem itm;
SPSite site = null;
SPWeb web = null;
string siteUrl = Request.Url.ToString();

site = new SPSite(siteUrl);
web = site.OpenWeb();
SPGroup grp = web.Groups[groupname];

itm=web.Lists["Shared Documents"].Items[0];

oUserRole = web.RoleDefinitions.GetByType(SPRoleType.Administrator);

oUserRoleAssignment = new SPRoleAssignment(loginName, emailId, userDisplayName, notes);//for user
or
oUserRoleAssignment = new SPRoleAssignment(grp);//for group

oUserRoleAssignment.RoleDefinitionBindings.Add(oUserRole);
itm.RoleAssignments.Add(oUserRoleAssignment);
web.AllowUnsafeUpdates = true;
itm.Update();
web.Update();
web.AllowUnsafeUpdates = false;

This is useful for setting item level permission via code.

tags: , , , ,

Sharepoint site does not exists at mentioned URL

Hi Guys,

While working on the Sharepoint, I came across this error “Sharepoint site does not exists at mentioned URL”. On searching something I found that we’ll have to change the URL under the Project Properties.

Enter Sharepoint Site URL

Enter Sharepoint Site URL

tags: , , , , ,
Page 1 of 41234