首先,我需要知道在哪里可以找到global.asax
文件。我已经建立了Sharepoint网站,现在我需要在Visual Studio中创建新项目,然后触发Application_BeginRequest
,以便在运行应用程序时获得用户的属性。因此,如何查找此文件以及如何继承此文件以使Application_BeginRequest
事件运行。
SharePoint默认global.asax文件路径:
要在SharePoint中自定义http模块,请创建一个继承自IHttpModule
的类,并将其注册到SharePoint配置文件中。
演示:
https://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-and-http-module/