HttpContext.Current return null in IIS 7
One of my team member was complaining to me that, the application works good at his development system but, when deployed to QC, the particular page throws a null exception.
I found that, the code ‘HttpContext.Current.Session[Constant.SortDirection]‘ is causing the error and the Current is null.
Inorder to fix this issue, the Session state should be set properly for the application in IIS.
Earlier, Session state was disabled because of which, the Current object is null. After setting the Session state, it worked correctly.