Tuesday, March 26, 2013

Solution to Sys.WebForms.PageRequestManagerParserErrorException

If all of the above doesn't Work I have a full proof Working solution :)
Add this Attribute to your script Manager EnablePartialRendering="true"

  Like below:  
  <ajaxToolkit:ToolkitScriptManager ID="_scriptManager" runat="server" ScriptMode="Release" CompositeScript-ScriptMode="Release" AllowCustomErrorsRedirect="False"  
     EnablePartialRendering="true" >  
   </ajaxToolkit:ToolkitScriptManager>  
 And in code behind write this code   
  Protected Sub _scriptManager_HandleErrors(ByVal sender As Object, ByVal e As AsyncPostBackErrorEventArgs) Handles _scriptManager.AsyncPostBackError  
     If e IsNot Nothing AndAlso e.Exception IsNot Nothing Then  
       Logger.Current.LogError(e.Exception.Message, e.Exception)  
       'Changed to catch the Error in Master Page Ajax Error Control Sys.webforms  
       _scriptManager.AsyncPostBackErrorMessage = e.Exception.Message  
     End If  
   End Sub  

No comments:

Post a Comment