You cannot use the Windows SharePoint Services object model with the ASP.NET BeginRequest event (831104)



The information in this article applies to:

  • Microsoft Windows SharePoint Services

SYMPTOMS

When you write code in a custom Web application that uses the Microsoft Windows SharePoint Services object model, you may find that you cannot use the object model with the Microsoft ASP.NET BeginRequest event.

For example, when you create a custom Web application in a subfolder of the Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template\Layouts folder, and the code uses the BeginRequest event, you may receive an exception error message.

CAUSE

This behavior occurs if the Windows SharePoint Services object model cannot retrieve the current user identity. The Windows SharePoint Services object model requires the current user identity from ASP.NET. However, the current user identity is not available during the BeginRequest event.

WORKAROUND

To work around this behavior, write your custom code by using the PreRequestHandlerExecute event instead of the BeginRequest event.

MORE INFORMATION

For additional information about the Windows SharePoint Services object model, see the Microsoft Windows SharePoint Services Software Development Kit (SDK). To obtain the Windows SharePoint Services SDK, visit the following Microsoft Web site: For more information about Windows SharePoint Services, visit the following Microsoft Web site:

Modification Type:MinorLast Reviewed:1/9/2006
Keywords:kbnofix kbBug KB831104 kbAudITPRO kbAudDeveloper