Monday, October 29, 2012

sharepoint web part display mode

Sometimes we need to check the web part mode i.e Is web part is in Edit mode or Display mode.

Based on this condition we have to do some coding..

For this SP has provided a property to check the mode of the web part.

SPContext.Current.FormContext.FormMode == SPControlMode.Edit;

Here we have four types of modes those are listed below

1. New

2. Edit

3. Display

4. Invalid

Happy coding !!!

No comments:

Post a Comment