In this hint, I explains How to create a SharePoint Redirect Page WebPart that redirect to specific page if the current user is not belong to a specific SharePoint security group by following the mentioned steps below :
- Create A new SharePoint Solution using Visual Studio.
- Add a new Visual Web Part.
- In load function add the following code
if (!SPContext.Current.Web.SiteGroups["groupname"].ContainsCurrentUser) { SPUtility.Redirect("url", SPRedirectFlags.Default, HttpContext.Current); }
Enjoy 🙂
See also