I want to perform few tasks during Session_Start and Session_End (when user logs in and logs out) through custom code. Where should i write it? Is it possible by writing a code behind for global.asax? Will it break anything?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can write Inline code (aka old style ASP) in the global.asax solution of your project. You can then implement your custom code in Session_Start.
You could also probably attempt do code behind, but the Global.Asax inherits from Microsoft.SharePoint.ApplicationRuntime.SPHttpApplication. You most likely need to override this DLL for it to work. Just guessing, have not tried.
Just a FYI in case you have not done session in SharePoint previously. Out of the Box SharePoint does not support session. You need to take a couple of steps to enable it.
John