When deploying a provider hosted app for SharePoint (Online), and you have a button on the app causing normal ASP.NET postback, whenever clicking on the button, you get error “An error occurred while processing your request.”
What is interesting is that the issue only occurs on IE11 on Windows 7. It doesn’t occur on IE11 on Windows 10, for example.
When debugging the SharePoint app at the time of clicking the button and postback, I saw that contrary to when entering the form with Windows7+IE11, there was a SPAppToken Form parameter, but on postback it was gone. Some people had solved it by manually taking the SPAppToken parameter and placing it into a hidden field on the page in order to ensure it was there also during postback.
I finally figured out solution, which didn’t involve any changes in the program code. On IE11 on Windows 7, you need to add the URL of the provider host app into Trusted Sites in IE11.
If app is hosted in Azure, the URL could be something like https://myproviderhostedapp.azurewebsites.net.