Repeater ItemCommand Throws Error When Executed Within Update Panelhttp://forums.asp.net/t/1806277.aspx/1?Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelWed, 23 May 2012 19:39:41 -040018062774992026http://forums.asp.net/p/1806277/4992026.aspx/1?Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRepeater ItemCommand Throws Error When Executed Within Update Panel <p>I have a repeater whose ItemCommand successfully fires when it is not contained within an Update Panel. However, if I place the Repeater within an Update Panel, it does not fire and causes some sort of AJAX error. Any ideas on where to start?</p> <p>Line: 939</p> <p>Char: 13</p> <p>Error: Sys.WebForms.PageRequestManagerParserErrorException. The message received from the server could not be parsed.</p> 2012-05-22T11:58:46-04:004992189http://forums.asp.net/p/1806277/4992189.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <ol> <li>Have you placed ScriptManager before the update panel? </li><li>Are you using Response Method in your code Like Response.Redirect etc. </li></ol> <p></p> 2012-05-22T13:05:02-04:004992201http://forums.asp.net/p/1806277/4992201.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <p></p> <blockquote><span class="icon-blockquote"></span> <h4>anuj_koundal</h4> <p></p> <p>Have you placed ScriptManager before the update panel. If yes post your source.</p> <p></p> </blockquote> <p></p> <p>Yes, its on the master page.&nbsp; The Repeater is actually on a User Control. The ItemCommand did successfully fire w/out throwing any errors up until I made some changes to the control, however the changes did not impact LinkButton that fires the event.</p> 2012-05-22T13:14:53-04:004992207http://forums.asp.net/p/1806277/4992207.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <p>See these post They May help.</p> <p><a href="http://forums.asp.net/t/1392827.aspx">http://forums.asp.net/t/1392827.aspx</a></p> <p><a href="http://stackoverflow.com/questions/1554728/the-message-received-from-the-server-could-not-be-parsed-common-causes-for-this">http://stackoverflow.com/questions/1554728/the-message-received-from-the-server-could-not-be-parsed-common-causes-for-this</a></p> <p><a href="http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx">http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx</a></p> <p></p> <p></p> 2012-05-22T13:20:01-04:004992320http://forums.asp.net/p/1806277/4992320.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <p>I've narrowed the most likely cause of the problem to the actual code that fires in the event. It creates a vCal file in memory and streams it to the client. The odd part of it is that it worked up until I made some unrelated changes to the user control in which the Repater sits. I'll probably just hack it and make the ItemCommand open a page that handles creating the vCal stand alone.</p> <pre class="prettyprint">Protected Sub RepeaterShowGateway_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles RepeaterShowGateway.ItemCommand Select Case e.CommandName Case &quot;CreateCalendarItem&quot; Exit Sub 'http://www.codeproject.com/KB/aspnet/vcalendarfiletodownload.aspx 'PARAMETERS Dim LabelNameLong As Label = CType(e.Item.FindControl(&quot;LabelNameLong&quot;), Label) Dim LabelBranchNameShort As Label = CType(e.Item.FindControl(&quot;LabelBranchNameShort&quot;), Label) Dim LabelShowNumber As Label = CType(e.Item.FindControl(&quot;LabelShowNumber&quot;), Label) Dim vcal_LabelTFCMoveIn As Label = CType(e.Item.FindControl(&quot;vcal_LabelTFCMoveIn&quot;), Label) Dim beginDate As Date = vcal_LabelTFCMoveIn.Text Dim vcal_LabelTFCClear As Label = CType(e.Item.FindControl(&quot;vcal_LabelTFCClear&quot;), Label) Dim endDate As Date = vcal_LabelTFCClear.Text 'INITIALIZATION Dim mStream As New MemoryStream() Dim writer As New StreamWriter(mStream) writer.AutoFlush = True 'HEADER writer.WriteLine(&quot;BEGIN:VCALENDAR&quot;) writer.WriteLine(&quot;PRODID:-//Flo Inc.//FloSoft//EN&quot;) writer.WriteLine(&quot;BEGIN:VEVENT&quot;) 'BODY writer.WriteLine(&quot;DTSTART;VALUE=DATE:&quot; &amp; _ beginDate.ToUniversalTime.ToString(&quot;yyyyMMdd&quot;)) writer.WriteLine(&quot;DTEND;VALUE=DATE:&quot; &amp; _ endDate.ToUniversalTime.ToString(&quot;yyyyMMdd&quot;)) writer.WriteLine(&quot;LOCATION:&quot;) 'Add Links here to Booking Report, QF, Sharepoint Folder and Show Site Dashboard writer.WriteLine(&quot;DESCRIPTION:&quot; &amp; &quot;Message Body Here&quot;) writer.WriteLine(&quot;SUMMARY:&quot; &amp; LabelNameLong.Text &amp; &quot; &quot; &amp; &quot;(&quot; &amp; LabelBranchNameShort.Text &amp; &quot;-&quot; &amp; LabelShowNumber.Text &amp; &quot;)&quot;) 'FOOTER writer.WriteLine(&quot;PRIORITY:3&quot;) writer.WriteLine(&quot;END:VEVENT&quot;) writer.WriteLine(&quot;END:VCALENDAR&quot;) 'MAKE IT DOWNLOADABLE Response.Clear() 'clears the current output content from the buffer Response.AppendHeader(&quot;Content-Disposition&quot;, _ &quot;attachment; filename=OutlookAppointment.vcs&quot;) Response.AppendHeader(&quot;Content-Length&quot;, mStream.Length.ToString()) Response.ContentType = &quot;application/download&quot; Response.BinaryWrite(mStream.ToArray()) Response.End() Case Else End Select End Sub</pre> <p></p> 2012-05-22T14:37:33-04:004992987http://forums.asp.net/p/1806277/4992987.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <p>Post Your .aspx code.</p> <p>If you are trying to open a new page using repeaters item command, make trigger of the item command.</p> 2012-05-23T04:40:53-04:004994457http://forums.asp.net/p/1806277/4994457.aspx/1?Re+Repeater+ItemCommand+Throws+Error+When+Executed+Within+Update+PanelRe: Repeater ItemCommand Throws Error When Executed Within Update Panel <p><span style="text-decoration:line-through"></span>For whatever reason, AJAX wasn't liking having the code that I posted execute when the _ItemCommand was being fired. I ended up abandoning the _ItemCommand event and simply went with JavaScript that opens a page which then executes the code. Technically this didn't solve the probelm, but it eliminated it by providing a viable workaround which actually&nbsp; creates a much more solid design as the code can now be executed from any point within the application.</p> <p>I have marked this thread as resovled, but without an answer as the root issue (executing the code posting with an AJAX UpdatePanel) was never actually resolved.</p> 2012-05-23T19:39:41-04:00