Problem: MethodAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)' to access method 'System.Web.UI.Control.get_ViewState()' failed
Possible Solution: Add the below line in web.config under <system.web> tag
<trust level="Full"/>