Welcome Guest Search | Active Topics | Sign In | Register

Is it possible to have multiple CallbackPanel controls in a page? Options
JT
Posted: Tuesday, December 9, 2008 2:44:23 AM
Rank: Newbie
Groups: Member

Joined: 12/9/2008
Posts: 3
I'm using a CallbackPanel control to load a .NET control into a main content area. Some of those .NET controls might have another CallbackPanel control to handle content update in that particular control. As expected, it shows the pop-up message about having multiple Callback/CallbackPanel controls in the page.

i wonder if there is a way to have multiple CallbackPanel controls in one page.
eo_support
Posted: Tuesday, December 9, 2008 5:08:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Can you post the error message? EO.Web CallbackPanel does support multiple CallbackPanels in the same page.

Thanks!
JT
Posted: Wednesday, December 10, 2008 7:34:48 PM
Rank: Newbie
Groups: Member

Joined: 12/9/2008
Posts: 3
Hi,

I tried having just one CallbackPanel on default page and added triggers to the CallbackPanel within ascx.cs file, but I had the error message: Trigger control 'ctl03_cboModules' for Callback 'ctlCallbackPanel' does not exist. Do you have any suggestions?

this's the code on my default page:
Code: HTML/ASPX
<eo:CallbackPanel ID="ctlCallbackPanel" runat="server" 
		        Height="100%" 
		        Width="100%"  
			QueueMode="KeepLast" LoadingHTML='
"padding-right:50px"><img src="Images/loading.gif" /></div>'> <eo:PageView id="ctlPageView" runat="server" EnableViewState="False" Width="100%"></eo:PageView> </eo:CallbackPanel>



and this's the code where i load ascx control
Code: C#
string fileName = @"Controls\" + node.Value.Replace("&", "and").Replace(" ", "") + @"\Control.ascx";

            if (File.Exists(Request.MapPath(fileName)))
            {
                System.Web.UI.Control control = Page.LoadControl(fileName);
                if (!ctlCallbackPanel.Controls.Contains(control))
                {
                    //EO.Web.Runtime.ResetState(control);
                    ctlCallbackPanel.Controls.Add(control);
                }
            }



and this's the code in ascx file to add trigger to the CallbackPanel

Code: C#
EO.Web.CallbackPanel callbackPanel = (EO.Web.CallbackPanel)Page.FindControl("ctlCallbackPanel");
        callbackPanel.Triggers.Add(new CallbackTrigger(cboModules.ClientID, ""));

eo_support
Posted: Thursday, December 11, 2008 5:35:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You should use cboModules.ID instead of cboModules.ClientID as the trigger ID. Also the trigger control (in your case cboModules) must be in the same naming container as the CallbackPanel.

Thanks!
JT
Posted: Thursday, December 11, 2008 8:43:46 PM
Rank: Newbie
Groups: Member

Joined: 12/9/2008
Posts: 3
Hi

Based on your demo, you use one callback panel in default page and use another callback panel on control (ex. Grid\Features\Checkbox Column). I was wondering if you could tell me how you could do that without having error message like this

The callback on 'xxxx' has failed because the server did not recognize this callback and processed it as a normal request. This can occur if there are multiple Callback/CallbackPanel controls in the page, ....

Besides, you told me that EO.Web CallbackPanel does support multiple CallbackPanels in the same page. This really confuses me so please tell me what's the trick i'm missing.

Thanks
eo_support
Posted: Friday, December 12, 2008 5:38:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Under normal circumstance it should just work. The problem often occurs when you load your control dynamically. The trick for dynamic loading is when you load something during initial load (when Page.IsPostBack is false), you must load it again when the page post back (when Page.IsPostBack is true). This is a general ASP.NET rule in order for a lot of things to work properly.

If you look at the code in default.aspx.cs/.vb, you will see that we use a hidden field to remember the path of last loaded demo and load it again during post back.

This post also explained this issue:

http://essentialobjects.com/Forum/Default.aspx?g=posts&t=1179#5018

Hope this helps.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.