How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

Last post 12-24-2009 4:51 AM by bhagatskhetwal. 82 replies.

Sort Posts:

  • How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-24-2007, 8:44 AM
    • Member
      115 point Member
    • asimiq80
    • Member since 01-24-2007, 1:32 PM
    • Posts 35

    Hi,

    i'm using ajax library for asp.net, in update panel i've added a button and on button click event i'm reading some data from server and want to save it in a file on client side but it is showing following error when i click the button:

    -----------
    Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

    Details: Error parsing near '"-""8L-'.

    --------------

    Here is a sample code which i'm using to write file against Button click event:

            Response.Clear();
            byte[] h = { 34, 45, 6, 34, 34, 56, 76, 45, 23 };

            Response.ContentType = "application/x-zip-compressed";
            Response.OutputStream.Write(h, 0, h.Length);

            Response.Flush();
            Response.End();

     
    when i place the button outside updatepanel, it works successfully. I need help to resolve this issue or let me know how can i do it asynchronously.

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-24-2007, 10:23 AM
    Answer
    • Participant
      1,277 point Participant
    • Rama Krishna
    • Member since 01-24-2006, 9:33 PM
    • Atlanta, GA
    • Posts 307

    Hi

    It is not a good practice to use Response.Write from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.

    You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 6:44 AM
    • Member
      115 point Member
    • asimiq80
    • Member since 01-24-2007, 1:32 PM
    • Posts 35
    Thanks, i've to do it asynchronously so i've done it with HttpHandler
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 11:46 AM
    • Participant
      1,135 point Participant
    • delorenzodesign
    • Member since 08-24-2005, 7:29 PM
    • Nutley, NJ USA
    • Posts 240

    Does anything else cause this issue?  I have no instances of Response.Write anywhere in my solution, the only HttpHandlers and HttpModules I have are the ones that are specified for ASP.Net AJAX RTM.

    My page has 5 PlaceHolders that simulate a Wizard-type control.  This page worked fine with RC1, but something is different with the RTM release.

     

     

     

    Michael De Lorenzo
    -------------------------------
    www.delorenzodesign.com
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 11:58 AM
    • Participant
      1,277 point Participant
    • Rama Krishna
    • Member since 01-24-2006, 9:33 PM
    • Atlanta, GA
    • Posts 307

    Have you analyzed the Response using Fiddler? Can you post some code or if you have the web site public, do you have a URL where the problem can be seen?

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 12:00 PM
    • Member
      25 point Member
    • jkuhlz
    • Member since 12-15-2006, 7:49 PM
    • Oklahoma City, OK
    • Posts 21

    I am having the exact same issue.

    It all worked fine with RC1 before upgrading to RTM. 

    However, after doing a lot of testing, I have found out that all of my update panels work fine if I don't login to my website using the asp.net Login Control.  As soon as I log though, some of my update panels quit working.  But what I don't get is that some of the update panels don't work, but others do???  Even though they are almost identical?  If I log back out, then the update panels start working again?

     Some of the errors I am getting are

    sys.WebForms.PageRequestManagerParserErrorException:  The Message received from the server could not be parsed.  Common causes 
    for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.  
    Details: Error parsing near '/div> 
       |html 
      <head>
      '.
     

    AND

    sys.WebForms.PageRequestManagerParserErrorException:  The Message received from the server could not be parsed.  Common causes 
    for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.  
    Details: Error parsing near '/ble> 
       |html 
      <head>
      '.
     So there is a pattern to the errors to?  I have did searches to see if I have any Response.Writes and I can't find any.
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 4:27 PM
    • Participant
      1,135 point Participant
    • delorenzodesign
    • Member since 08-24-2005, 7:29 PM
    • Nutley, NJ USA
    • Posts 240
    Can anyone from the ASP.Net AJAX team shed some light on this issue?
    Michael De Lorenzo
    -------------------------------
    www.delorenzodesign.com
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-25-2007, 4:46 PM
    • Member
      85 point Member
    • danehrig
    • Member since 08-22-2006, 9:06 PM
    • Posts 52
    Just posting to confirm that I am also having this issue and it only occurs after forms authentication.  Help!
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-26-2007, 11:54 AM
    • Member
      25 point Member
    • jkuhlz
    • Member since 12-15-2006, 7:49 PM
    • Oklahoma City, OK
    • Posts 21

    No Resolutions Yet?

     

    I have incorporated the ELMAH into this website to record and track errors, etc.  I was doing some more testing and noticed that every time this error occurs this is the error that gets recorded.  So going to look into this.  Wanted to post it incase anyone else can come up with a resolution with this error description.

     

    System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.

    Generated: Fri, 26 Jan 2007 16:43:47 GMT

    System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.
       at System.Web.HttpCookieCollection.Add(HttpCookie cookie)
       at System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    		

    Server Variables

    Name Value
    ALL_HTTP HTTP_CACHE_CONTROL:no-cache HTTP_CONNECTION:Keep-Alive HTTP_CONTENT_LENGTH:7576 HTTP_CONTENT_TYPE:application/x-www-form-urlencoded HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-us HTTP_COOKIE:ASP.NET_SessionId=ptcudiv20lmin4mdg4oouh55; .Website=2A079D0B611FD215B86E454EEDCCDDE31394FD2CF84F30689AB25112D546BCC65A621A55AA3A05B9242A0BE1EFE432F5CFEBAF170253D81B9C2A813C5E3E1FFCE9ECA3CEE1482AFDEB2D14D1D3544EE6; .ASPXROLES=BRNICMT10Wa13bkTSW86L2WaDB6AFeF_Q4cHwTOmqZ4yPzdt_vT-0ajYrs0aZbcmXx2RoKDU2fx2rWIfx5kmrOwTtSbPwaHJ60D6P94dqJgPhqnt2C1f-58K_vIrr75Ug8TdhUF4AI_DJVdPizSAghQy-EW36jhLEPew4Gf1WRNL0nW9w6-l_2IifrR0JGV5hJ42aSkcY31C6A8BSVDhHBUY4trAt9zGkZ9s8jNikSmfyClJlMXBN9FMhlkxjKM-rkY-AB86YK4BgUxU6-uGp-J2HqaR02HQMVgUw4h9U4LdWAAqS4dIQMAR73hc-pZmCF1nG4RGcDqFrjkF7m26EaFTRgY16fRnnZERq7QL_n_K6zYvFqLOtUJDKhbcrFKSb9LtYcGidTFr_GYgv-05ffjg9rRrTcxBagr7SnOD0ejcXF6SuwRAsyvXEsXp2eYvDYM9Os9empMJAYZBYwxRww2
    ALL_RAW Cache-Control: no-cache Connection: Keep-Alive Content-Length: 7576 Content-Type: application/x-www-form-urlencoded Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-us Cookie: ASP.NET_SessionId=ptcudiv20lmin4mdg4oouh55; .OKCMAR=2A079D0B611FD215B86E454EEDCCDDE31394FD2CF84F30689AB25112D546BCC65A621A55AA3A05B9242A0BE1EFE432F5CFEBAF170253D81B9C2A813C5E3E1FFCE9ECA3CEE1482AFDEB2D14D1D3544EE6; .ASPXROLES=BRNICMT10Wa13bkTSW86L2WaDB6AFeF_Q4cHwTOmqZ4yPzdt_vT-0ajYrs0aZbcmXx2RoKDU2fx2rWIfx5kmrOwTtSbPwaHJ60D6P94dqJgPhqnt2C1f-58K_vIrr75Ug8TdhUF4AI_DJVdPizSAghQy-EW36jhLEPew4Gf1WRNL0nW9w6-l_2IifrR0JGV5hJ42aSkcY31C6A8BSVDhHBUY4trAt9zGkZ9s8jNikSmfyClJlMXBN9FMhlkxjKM-rkY-AB86YK4BgUxU6-uGp-J2HqaR02HQMVgUw4h9U4LdWAAqS4dIQMAR73hc-pZmCF1nG4RGcDqFrjkF7m26EaFTRgY16fRnnZERq7QL_n_K6zYvFqLOtUJDKhbcrFKSb9LtYcGidTFr_GYgv-05ffjg9rRrTcxBagr7SnOD0ejcXF6SuwRAsyvXEsXp2eYvDYM9Os9empMJAYZBYwxRww2
    APPL_MD_PATH  
    APPL_PHYSICAL_PATH
    AUTH_TYPE Forms
    AUTH_USER
    AUTH_PASSWORD  
    LOGON_USER
    REMOTE_USER
    CERT_COOKIE  
    CERT_FLAGS  
    CERT_ISSUER  
    CERT_KEYSIZE  
    CERT_SECRETKEYSIZE  
    CERT_SERIALNUMBER  
    CERT_SERVER_ISSUER  
    CERT_SERVER_SUBJECT  
    CERT_SUBJECT  
    CONTENT_LENGTH 7576
    CONTENT_TYPE application/x-www-form-urlencoded
    GATEWAY_INTERFACE  
    HTTPS  
    HTTPS_KEYSIZE  
    HTTPS_SECRETKEYSIZE  
    HTTPS_SERVER_ISSUER  
    HTTPS_SERVER_SUBJECT  
    INSTANCE_ID  
    INSTANCE_META_PATH  
    LOCAL_ADDR 127.0.0.1
    PATH_INFO
    PATH_TRANSLATED
    QUERY_STRING  
    REMOTE_ADDR 127.0.0.1
    REMOTE_HOST 127.0.0.1
    REMOTE_PORT  
    REQUEST_METHOD POST
    SCRIPT_NAME
    SERVER_NAME localhost
    SERVER_PORT 2509
    SERVER_PORT_SECURE 0
    SERVER_PROTOCOL HTTP/1.1
    SERVER_SOFTWARE  
    URL
    HTTP_CACHE_CONTROL no-cache
    HTTP_CONNECTION Keep-Alive
    HTTP_CONTENT_LENGTH 7576
    HTTP_CONTENT_TYPE application/x-www-form-urlencoded
    HTTP_ACCEPT */*
    HTTP_ACCEPT_ENCODING gzip, deflate
    HTTP_ACCEPT_LANGUAGE en-us
    HTTP_COOKIE ASP.NET_SessionId=ptcudiv20lmin4mdg4oouh55; .Website=2A079D0B611FD215B86E454EEDCCDDE31394FD2CF84F30689AB25112D546BCC65A621A55AA3A05B9242A0BE1EFE432F5CFEBAF170253D81B9C2A813C5E3E1FFCE9ECA3CEE1482AFDEB2D14D1D3544EE6; .ASPXROLES=BRNICMT10Wa13bkTSW86L2WaDB6AFeF_Q4cHwTOmqZ4yPzdt_vT-0ajYrs0aZbcmXx2RoKDU2fx2rWIfx5kmrOwTtSbPwaHJ60D6P94dqJgPhqnt2C1f-58K_vIrr75Ug8TdhUF4AI_DJVdPizSAghQy-EW36jhLEPew4Gf1WRNL0nW9w6-l_2IifrR0JGV5hJ42aSkcY31C6A8BSVDhHBUY4trAt9zGkZ9s8jNikSmfyClJlMXBN9FMhlkxjKM-rkY-AB86YK4BgUxU6-uGp-J2HqaR02HQMVgUw4h9U4LdWAAqS4dIQMAR73hc-pZmCF1nG4RGcDqFrjkF7m26EaFTRgY16fRnnZERq7QL_n_K6zYvFqLOtUJDKhbcrFKSb9LtYcGidTFr_GYgv-05ffjg9rRrTcxBagr7SnOD0ejcXF6SuwRAsyvXEsXp2eYvDYM9Os9empMJAYZBYwxRww2
    HTTP_HOST localhost:2509
    HTTP_REFERER
    HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
    HTTP_X_MICROSOFTAJAX Delta=true
    HTTP_UA_CPU x86

    Powered by ELMAH, version 2.0.50727.42. Copyright (c) 2004, Atif Aziz, Skybow AG. All rights reserved.

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-27-2007, 2:46 PM
    • Member
      30 point Member
    • liquidboy
    • Member since 08-08-2006, 2:24 AM
    • Sydney
    • Posts 11

    Im just writting to let you know that im also getting the issue.

     Update panels after loging-in keep throwing up the above mentioned error.

     The postback code in the button which causes the partial page rendering is shown below...

    ps.. Was working fine prior to RTM!

     

    Code in ============================

      

    1        protected void butSaveComment_click(object sender, EventArgs e)
    2        {
    3            string uid = Request.QueryString["aa1"];
    4            string username = "";
    5    
    6            if (taComment.Text.Trim().Length == 0) return;
    7    
    8            username = Membership.GetUser() == null ? "Anonymous" : Membership.GetUser().UserName;
    9    
    10           dsBusinessObjectsTableAdapters.RipThatClip_commentsTableAdapter oTA = new dsBusinessObjectsTableAdapters.RipThatClip_commentsTableAdapter();
    11           dsBusinessObjectsTableAdapters.RipThatClip_ClipsTableAdapter oPTA = new dsBusinessObjectsTableAdapters.RipThatClip_ClipsTableAdapter();
    12   
    13           string safeHTML_Comment = Server.HtmlEncode(taComment.Text);
    14   
    15           oTA.Insert(Guid.NewGuid().ToString(), oPTA.GetDataByUID(uid)[0].id, safeHTML_Comment, username, DateTime.Now, uid);
    16           oPTA.IncrementComment(uid);
    17   
    18           divComments.InnerHtml = getComments();
    19       }
    
     

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-29-2007, 10:21 AM
    • Member
      25 point Member
    • jkuhlz
    • Member since 12-15-2006, 7:49 PM
    • Oklahoma City, OK
    • Posts 21

    After further testing this issue, I have found that in my particular situation, this error is occuring when the code Roles.GetRolesForUser(username) is executed.  Specifically when the username being passed to the function is the username of the person currently logged into the website.  If I were to pass some static username to this function, it all works as long as it wasn't the same as the actual username of the person logged in.

     For example, I have an ajax-enabled grid-view that displays information.  The information that is displayed is based on what role the currently logged in user is in. This grid-view is also available so the general public can see it without logging in. 

     So when a user comes to the website and views the information in the grid-view all works fine because the Roles.GetRolesForUser() is never called.  However as soon as a user logs in to the website, and looks at the grid-view, the Roles.GetRolesForUser() is executed and I get this error when doing a AsyncPostback.

    sys.WebForms.PageRequestManagerParserErrorException:  The Message received from the server could not be parsed.  Common causes 
    for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.  
    Details: Error parsing near '/div> 
       |html 
      <head>
      '.

     Still looking for an answer.....

    Hopefully someone can shed some light here!

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-29-2007, 10:38 AM
    • Member
      85 point Member
    • danehrig
    • Member since 08-22-2006, 9:06 PM
    • Posts 52

    Based on jkuhlz's post I tried removing all references to the user object in my page, instead sticking them into the session at login time.  Unfortunately that didn't fix the problem.  I assume that's because roles.getrolesforuser is still getting excecuted when the page is accessed because the directory is protected on a role basis.

     It would be nice if one of the MS guys could acknowledge this issue.
     

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-29-2007, 11:12 AM
    • Contributor
      2,460 point Contributor
    • Steve Marx
    • Member since 05-26-2006, 8:35 PM
    • Microsoft
    • Posts 643

    I'm getting some help from the product team on this... I'll update this thread as soon as I know more.  If anyone has some easy-to-follow steps to reproduce the bug, that would probably help a lot!

    Thanks for all the detailed information so far.

    Steve Marx | ASP.NET AJAX Evangelist | Microsoft Corporation
  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-29-2007, 11:20 AM
    • Member
      85 point Member
    • danehrig
    • Member since 08-22-2006, 9:06 PM
    • Posts 52

    Here's steps to duplicate it that I wrote in my other thread about this issue:

     

    • Create a new project using the AjaxEnabledWebsite template. 
    • Added a Default.aspx webpage with a label and a button control.   Button_click changes the label text. Tested this, it was fine. 
    • Added an UpdatePanel surrounding the label.
    • Added forms authentication to the web.config, it was fine. 
    • Added a subdirectory protected with forms authentication and moved my Default.aspx into it.  Login works fine, but the exception is thrown when I click the button.

     

  • Re: How to resolve "Sys.WebForms.PageRequestManagerParserErrorException" issue

    01-29-2007, 11:29 AM
    • Member
      25 point Member
    • jkuhlz
    • Member since 12-15-2006, 7:49 PM
    • Oklahoma City, OK
    • Posts 21

    Solved, my problem!

     

    After trying about everything, I started messing with my Web.Config.  In my web app, I had created a custom Role provider.  When I declared my custom role provider in the web config, 

     

    <roleManager enabled="true" defaultProvider="CustomSQLRoleProvider" cacheRolesInCookie="true" createPersistentCookie="false">
    			<providers>
    				<add name="CustomSQLRoleProvider" type="CustomSQLRoleProvider" connectionStringName="DataConn_OKCRealtors_Admin" commandTimeout="30"/>
    			</providers>
    		</roleManager>

     I changed the cacheRolesInCookie="true" to cacheRolesInCookie="false" and everything is working fine now???? 

     I am doing more testing, but it seems to have solved my particular issue.

Page 1 of 6 (83 items) 1 2 3 4 5 Next > ... Last »