Tuesday, July 11, 2017

Set unique permission for SharePoint Page

Target audience doesn't work in office 365, so there is an different approach to perform unique permission.

Step:1
Go to site contents--> Site Pages--> select the dotted link on the Home page

Step:2
After popping out the link, click share and provide the user name or your desired group name - Now you are all set to go.

You can now view the page as unique to the selected users.



Monday, July 10, 2017

Object reference not set to an instance of an object in SharePoint C#

Error

I was working on a project where grid view needs to be edited and updated.

When I try to deploy the web part, error throws as below

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Workaround:

The error occurred before on init event, using the log I just came to the conclusion that controls in the page is throwing an error, Exactly as expected, the script is loading before page load as null.
I just set null to the control and its works