Apr 282010
Unter SharePoint 2010 ist es nun möglich, eigene Pages für bestimmte Events zu hinterlegen. Dies geht über die SPCustomPage Enumeration:
| none | |
| AccessDenied | Specifies AccessDenied.aspx. |
| Confirmation | Specifies Confirmation.aspx. |
| Error | Specifies Error.aspx. |
| Login | Specifies Login.aspx. |
| RequestAccess | Specifies ReqAcc.aspx. |
| Signout | Specifies SignOut.aspx. |
| WebDeleted | Specifies WebDeleted.aspx. |
Die neue Page kann über ein Webapplication Feature per FeatureReceiver zugewiesen werden.
const string ErrorPage = "/_layouts/CustomEventPages/error.aspx";
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
if (webApp != null)
{
if (!webApp.UpdateMappedPage(SPWebApplication.SPCustomPage.Error, ErrorPage))
{
throw new Exception("Neue Fehlerseite konnte nicht registriert werden!");
}
webApp.Update(true);
}
}
Hierbei wird nun eine neue Errorpage gesetzt, die zusätzliche Informationen für den Anwender oder ein eigenes Layout beinhalten könnte.
Letzte Kommentare