As the title said, I need to raise (from the C# code behind a custom SharePoint page) a 401 error page. Any help?
A:
Kindly refer the link below,
http://www.codeproject.com/KB/sharepoint/Errorhandling_in_Webparts.aspx
solairaja
2009-10-21 08:31:04
+3
A:
Try this:
throw new HttpException(401, "Unauthorized access");
Rubens Farias
2009-10-21 08:48:18
+1
A:
If the exception is SharePoint related it's best to throw a SharePoint exception
throw new SPException("Not Authorized");
See also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spexception.aspx
W0ut
2009-10-21 12:21:46