Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Asynchronous postback not working in CRM 2011 ISV code

$
0
0

I'm working on upgrading some ISV code from a 4.0 deployment to 2011, but I can't seem to get async postbacks to work when the ASP.NET page is running under the CRM 2011 site.

To simplify debugging, I've created a test page that looks like this:

 

<%@PageLanguage="C#"AutoEventWireup="true"CodeBehind="Default.aspx.cs"Inherits="Crm.IsvTest.Default"Src="Default.aspx.cs"EnableViewState="false"EnableSessionState="False"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title></head><body><formrunat="server"><asp:ScriptManagerrunat="server"/><asp:UpdatePanelrunat="server"><ContentTemplate><labelid="lblTest"runat="server"></label><br/><br/><asp:ButtonID="Button1"Text="Refresh"runat="server"/></ContentTemplate></asp:UpdatePanel></form></body></html>

And in the code behind...

using System;using System.Web.UI;using System.Web.UI.HtmlControls;namespace Crm.IsvTest
{publicclass Default : Page
 {protected HtmlGenericControl lblTest;protectedvoid Page_Load(object sender, EventArgs e)
 {
 lblTest.InnerHtml = "Updated at "+ DateTime.Now;
 }
 }
}

 


If I run this page on a non-CRM site in IIS it works 100%.

When running it under the ISV folder (i.e. http://crm/MyOrg/ISV/Default.aspx),the very 1st postback works, but subsequent ones fail on the server. The error is:

 

[FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. ]
 System.Convert.FromBase64String(String s) +0
 System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +91
 System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +207

[ViewStateException: Invalid viewstate. 
%09Client IP: ::1
%09Port: 52666
%09Referer: http://localhost/<PathToDefault.aspx>
%09Path: /<PathToDefault.aspx>
%09User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
%09ViewState: &amp;#47;wEWAgKhl92gAwKM54rGBs06bSd&amp;#47;Yl9IsDpH9gkTCHvBBUN4Fsuy2X2ocYMoR2Yr]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
 System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +3382148
 System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +11179752
 System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +75
 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +41
 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11265679
 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11265198
 System.Web.UI.Page.ProcessRequest() +119
 System.Web.UI.Page.ProcessRequest(HttpContext context) +167
 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +597
 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +266

 

Please note that I am explicitly disabling viewstate on the page.

Any ideas as to what in the CRM 2011 pipeline would be breaking async postbacks? The exactsame code runs perfectly fine under CRM 4.0 as well.

Thanks!







Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>