9

Closed

AjaxContainer : sys.invalidoperationexception owner must be set before initialize

description

I have all the tabpanels well placed within the tabcontainer and yet get the error. Works fine in the dev environment and most live users do not have a problem.But throws this error to users on a slow machine/network. Problem here is tabpanels cannot find the tabcontainer.

This issue has been reported several times by various people, but the issue status has been marked as "Closed" without actually providing a resolution. This is really frustrating. Could you please provide a quick patch as soon as possible? Thanks.

file attachments

Closed Dec 14, 2013 at 1:40 AM by Superexpert

comments

VinChow wrote Apr 26, 2010 at 7:59 PM

I would like to know if there is any workaround to this problem too. It seems there is no permanent solution after hours spent on Googling.

Abdul wrote Jun 23, 2010 at 2:41 PM

Even spending half a day... i don't find any fix for this. It seems the issue persist from 2008. How come a problem surviving for 2 years.. without have a fix from microsoft community ?

scovel wrote Jul 1, 2010 at 12:22 PM

This is still happening. This appears to be a timing issue. Only happens under load/slow page load. This is making the control unusable. Is there any work being done on this issue?

scovel wrote Jul 1, 2010 at 3:31 PM

I can recreate it fairly simply. I created a new project, added the tab container, and two tabs. I added an Infragistics Grid to each tab. Added some columns to each grid. Compile and run. Works fine. Load the machine down (I usually compile and run unit tests on another project) and hit refresh a few time. Boom!

Microsoft JScript runtime error: Sys.InvalidOperationException: Component 'TabContainer1' was not found.

stack:
JScript anonymous function JScript
_forIn  JScript
Component$_setReferences    JScript
Component$_register JScript
Component$create    JScript
JScript anonymous function  JScript
_Application$add_init   JScript
JScript global code JScript
Application attached.

bkuhn wrote Aug 9, 2010 at 7:26 PM

It appears the workaround is to not use the Tabcontainer control for any complex layout. I've fought with this issue over and over and the only reliable fix is to toss the tabcontainer. I create DIVs instead of TabPanels and use buttons instead of tabs. Click a button - make the associated DIV visible and hide all the others. Rock solid reliable.

creativbox wrote Aug 30, 2010 at 5:51 PM

Hi all,

if I remember correctly, this bug is caused by a wrong rendering order of the tab container and tab pages initialization scripts. The tab panels can be initialized prior to the container and are therefore failing. This depends on the client sides timing. I have fixed this by changing the rendering order of the initialization scripts and ensuring that the container is initialized before any tab panel.

Override Render() in TabContainer.cs with the following method:

protected override void Render(HtmlTextWriter writer)
{
//Do not call base, we must ensure that our ScriptDescriptors are added before the client controls
//are rendered
//base.Render(writer);

this.Page.VerifyRenderingInServerForm(this);

if (!base.DesignMode)
{
    //Register the tab containers script descriptor before any tab panel is rendered. The base 
    //implementation will register the descriptor after RenderContents() and therefore after the 
    //tab panels are registered.
    this.ScriptManager.RegisterScriptDescriptors(this);
}

//Same as base.Render() but after RegisterScriptDescriptors
this.RenderBeginTag(writer);
this.RenderContents(writer);
this.RenderEndTag(writer);
}

I hope this helps.
Kind regards,
Georg

mise wrote Sep 2, 2010 at 4:29 PM

Thanks for the code creativbox.
I'm experiencing the exact same problems as described here. I've taken the code suggested by createbox and it fixes the problem for IE and FF ... the problem still remains for Chrome though ... bizzare!

Is this going to be fixed?

creativbox wrote Sep 3, 2010 at 7:59 AM

I've not experienced this error on Chrome anymore. Not sure if there are more/other errors...

molay wrote Sep 15, 2010 at 10:32 AM

Seems like that this issue is still present in Ajaxtoolkit TabContainer.
I have done the following things but still getting same error:
  1. My TabContainer is already organized as per "Microsoft Online Community Support" (http://forums.asp.net/p/1426211/3179828.aspx#3179828)
  2. Remove ScriptManager from master page and put in individual pages that contains TabContainer.
  3. Try to set ownerid to TabContainer using js
  4. Try to set visibility=true to TabContainer
  5. and finally after going through following link
    a) http://ajaxcontroltoolkit.codeplex.com/workitem/23482
    b) http://ajaxcontroltoolkit.codeplex.com/workitem/26552
    c) http://ajaxcontroltoolkit.codeplex.com/workitem/26491
    d) http://forums.asp.net/t/1099039.aspx
    I believe that this bug is still present in Ajaxtoolkit TabContainer:
    If anybody have solved it then pls post your reply here.
    In advance thanks,

Manish_jain1980 wrote Dec 8, 2010 at 11:19 AM

really its very painful job, i spent lots of time to develop application and finally when i load it on server tabs control fail to load tab panel

jleelim wrote Dec 18, 2010 at 4:03 AM

I'm seeing the same issue on a slow network with version 3.0.30930 on IE8 and FF. Is there a plan to fix this? This bug existed for a long time and breaks the pages badly. I'm tempted to switch over to jQuery because I absolutely need a workable tabs.

RoscoHead wrote May 9, 2011 at 12:56 AM

Still seems to be an issue, depending server load, bandwidth load, etc. I added creativebox code and verified that the init for TabContainer is now called before all TabPanels, but the problem still persists (note I have also moved all my TabPanel content to divs that I show/hide in OnClientActiveTabChanged. This is pretty annoying.

philipnh wrote Sep 1, 2011 at 2:47 PM

I still have this issue occurring in version 3.5.50731.0. ScriptManager is in a masterpage and every so often the tabcontainer just doesn't display at all. I need to know if there is a definite solution to this - I dont want to waste time trying to solve a 2yr old problem if the answer is to just bin the ajax tabControl and use Jquery instead. Please provide an update ASAP.

sands904 wrote Dec 9, 2011 at 12:36 AM

Any fix for this? I have an application that really needs this to be working ASAP! Thanks!