Microsoft KB Archive/831104

= You cannot use the Windows SharePoint Services object model with the ASP.NET BeginRequest event =

Article ID: 831104

Article Last Modified on 9/26/2007

-

APPLIES TO


 * Microsoft Windows SharePoint Services
 * Microsoft Windows SharePoint Services 3.0

-





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 :\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:

http://www.microsoft.com/downloads/details.aspx?familyid=1c64af62-c2e9-4ca3-a2a0-7d4319980011&displaylang=en

For more information about Windows SharePoint Services, visit the following Microsoft Web site:

http://technet.microsoft.com/windowsserver/sharepoint/default.aspx

Additional query words: wss WSSv3 WSSv2

Keywords: kbbug kbnofix KB831104

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.