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 5:15:15 AM
Gravatar
Total Posts 10

Child site UpdatePanels not working

I have found that trying to use updatepanels in a child site does not work properly. I have two updatepanels one with a repeater of links, when clicked it updates the data in the second update panel. It works the first time I click it, the second time fails with no response and the third time, it does a postback to the parent website. All of this works as a parent site, just not as a child site in an ascx file.

I am using 2-2-6-8 with asp.net 3.5 on vs2008.

Cheers

Ken

8/22/2008 6:06:41 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

Hi Ken,

You are talking about a problem in your own custom code right?

You should have posted this in the developer forum, it is NOT a mojoportal bug, is it? If you think it is please post steps to reproduce it in mojoportal demo site.

demo.mojoportal.com is a child site and update panel works fine in the blog. If you go to add or edit a blog post, on that page if you add new categories it is using an update panel around the category list.

The first thing I would check is if something is different in the layout.master file of your child sites in the way <ScriptManager is declared

Hope it helps,

Joe

 

8/22/2008 6:14:54 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Hi Joe,

I have tried running my code on the parent site without any problems, it only happens when I place it in a child site. Regarding the layout.master, does it not use the one already in the web folder? or do I have to have one an App_MasterPages folder in my child site folder?

Cheers

Ken

8/22/2008 6:21:43 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

Each sites uses the skins located beneath /Data/Sites/[SiteID]/skins

so skins are isolated between sites, they do not share them. When a new site is created skins are copied to the site specific location from the catalog of skins located under /Data/skins

the layout.master used at runtime is the one in ths skin folder for the selected skin beneath the specific site skins directory

Hope it helps,

Joe

8/22/2008 6:29:48 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

I have check the skin and it seems fine, apart from checking these are there any other factors that could lead to such problems? I have set the "UseFoldersInsteadOfHostnamesForMultipleSites" to true if that helps.

Cheers

Ken

8/22/2008 6:33:06 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

All I have done is setup the site and then created a child site. in this child site I have written a very simple ascx page which uses UpdatePanels to update contents of a repeater, and apart from the change in the web.config mentioned earlier, nothing else has been changed.

8/22/2008 6:39:02 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

I would compare how you are hooking things up for your update panel to how I did it in BlogEdit.aspx.cs

I'm ajaxifying my button click like this:

if (ScriptController != null)
{
ScriptController.RegisterAsyncPostBackControl(btnAddCategory);
}

ScriptController is just aproperty that gets a reference to ScriptManager from master page:

public ScriptManager ScriptController
{
get
{
if (scriptController == null)
{
scriptController = (ScriptManager)Master.FindControl("ScriptManager1");
}

return scriptController;
}

}

My Update panel is declared like this:

<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">

I would examine your code and my code in the BlogEdit.aspx.cs and see if you can find substantial differences.

The problem could be because you want to update on panel from another one. I would try doing it all in one update panel.

Hope it helps,

Joe

8/22/2008 6:53:11 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

Because my links in both repeaters are already in a single update panel, I won't need to register them as asyncpostbacks right? When I click a link on repeater1, repeater2 will be populated and the updatepanel.Update will be called to refresh the panel.

Heres what my ascx file looks like:

<asp:UpdatePanel ID="upCategories" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Repeater ID="rpCategories" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkCategories" runat="server" Text='<%#Eval("Category") %>'
CategoryID='<%#Eval("CategoryID") %>' OnClick="lnkCategories_Click"></asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
<asp:DataList ID="rpSubCategories" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkSubCategories" runat="server" Text='<%#Eval("SubCategory") %>'
SubCategoryID='<%#Eval("SubCategoryID") %>' OnClick="lnkSubCategories_Click"></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</asp:UpdatePanel>

 

My CS file has these methods:
protected void Page_Load(object sender, EventArgs e)
{
this.rpCategories.DataSource = Categories.GetCategoryList();
this.rpCategories.DataBind();
}

protected void lnkCategories_Click(object sender, EventArgs e)
{
this.rpSubCategories.DataSource = SubCategories.GetSubCategoryList(((LinkButton)sender).Attributes["CategoryID"].ToString()); ;
this.rpSubCategories.DataBind();
this.upCategories.Update();
}

Appreciate your help!

Ken

8/22/2008 7:14:54 AM
Gravatar
Total Posts 18439

Re: Child site UpdatePanels not working

I don't think you even could register those buttons for async because they repeat inside a repeater.

What I would do is remove the onclick from those buttons and just give them a commandname and then hookup the repeater async like I did the button in the blog and move the code from that button event into itemcommand  on the repeater.

I'm just suggesting things I would try.

Hope it helps,

Joe

8/22/2008 7:25:36 AM
Gravatar
Total Posts 10

Re: Child site UpdatePanels not working

I will give that a try, but it does work in the parent site though?

Ken

 

**Update**

It didn't work, I had the same behavior as before

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
 

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