Child site UpdatePanels not working

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
8/22/2008 7:48:47 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Joe,

The problem still persists, but the funny thing is though, when I click it the first time, it gives the expected result, then I click it for the second time and the page title changes to the parent page title, and finally the third time, it throws the following error.

Exception Details: System.Web.HttpException: The state information is invalid for this page and might be corrupted.

[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
ViewState: /wEWIAKi4/6cAgKllvq1BgKllvbODgKolvLrBAKMls6bAQKnlsqwAwKnlobLCwKiloLoAQKmlp6JDgKiltq9DAKhltbWBALhsYTwDwKarLruDwLXmYvrDwLYyLLxDwLV+fLxDwKe7svwDwLL25ztDwKcjsTrDwKJ/cHzDwLinrryDwKH8IHUBwKH8P3sDwKK8PmJBgLu79W5AgKJ8NHOBAKJ8I3pDAKE8ImGAwKI8KWnDwKE8OHbDQKD8N30BQLcqYWMCg==
Referer: http://localhost:3529/testbed/testbed.aspx
Path: /Default.aspx]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +267
System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +2133067
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +66
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +32
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\de64b9f9\2255b98b\App_Web_kcay04ft.20.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
 

8/22/2008 8:01:04 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

If I google for "update panel viewstate error" I see lots of results. I would review those results and look for possible solutions.

Hope it helps,

Joe

8/22/2008 8:36:15 PM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Joe,

After trying different ways to overcome the problem with no success, I figured the only difference between the blog page and mine was asp and ascx. So I created a new aspx page and dropped it into a child site and its working fine. So I guess this is a bug after all, it only fails in an ascx page.

Cheers
Ken

8/23/2008 4:51:08 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

Hi Ken,

Poll features uses an UpdatePanel inside a .ascx (See PollMudule.ascx)

Try adding this to your .ascx and see if it fixes it:

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Page.EnableViewState = true;
}

Hope it helps,

Joe

8/25/2008 1:35:58 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Still didn't work, would there be any settings in web.config that would affect the ajax?

Cheers
Ken

8/25/2008 11:57:56 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

Did you try the Poll in child sites? If it works then compare it to your custom code.

Nothing I can think of in Web.config will affect it, I mean all sites share the same Web.config.

Best,

Joe

9/23/2008 10:45:02 PM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Hi Joe,

I have tried and tried to get this working with no success and have found that even the simplest of controls in an UpdatePanel does not work. I have created a simple User Control with two buttons updating a label, this is used in a Child Site, could you see if this works on your end please? I did try poll, but as I told you before, it only fails on the second attempt to click a link, whereas Poll only gives you one chance.

Cheers
Ken

ASPX
<asp:UpdatePanel ID="upCategories" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" Text="One"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" Text="Two"></asp:LinkButton>
<asp:Label ID="lblSelectedValue" runat="server" Text="None Selected"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

CS
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.LinkButton1.Click += new EventHandler(LinkButton1_Click);
this.LinkButton2.Click += new EventHandler(LinkButton2_Click);
Page.EnableViewState = true;
this.upCategories.Update();
}
protected void Page_Load(object sender, EventArgs e)
{
RegisterAsynLinks();
}
private void RegisterAsynLinks()
{
((ScriptManager)Page.Master.FindControl("ScriptManager1")).RegisterAsyncPostBackControl(this.LinkButton1);
((ScriptManager)Page.Master.FindControl("ScriptManager1")).RegisterAsyncPostBackControl(this.LinkButton2);
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
this.lblSelectedValue.Text = ((LinkButton)sender).Text;
this.upCategories.Update();
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
this.lblSelectedValue.Text = ((LinkButton)sender).Text;
this.upCategories.Update();
}

8/20/2009 11:57:36 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

I encountered this issue today in the Shared Files module in folder based child sites.

Using Firebug I noticed that after the first postback in my datagrid (inside an UpdatePanel) the form action changed and this made the next postback incorrect.

I was able to fix it by adding this in my LoadSettings method:

Page.Form.Action = SiteUtils.GetCurrentPageUrl();

and this kept the action consistent across postbacks in the update panel and fixed the problem for me.

Best,

Joe 

You must sign in to post in the forums. This thread is closed to new posts.