Update of /cvsroot/magicajax/magicajax/Core/UI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26903/Core/UI
Modified Files:
RenderedByScriptControl.cs
Log Message:
Fixed a visibility issue.
CONTROL_FINGERPRINTS are registered at OnLoad event in case an AjaxPanel has Visible property set to false.
Index: RenderedByScriptControl.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RenderedByScriptControl.cs 18 Nov 2005 19:18:12 -0000 1.7
--- RenderedByScriptControl.cs 19 Nov 2005 01:31:23 -0000 1.8
***************
*** 274,278 ****
if ( ! this.Visible )
{
! _isRenderedOnPage = false;
return;
}
--- 274,278 ----
if ( ! this.Visible )
{
! _isRenderedOnPage = HasVisibleNotRenderedByScriptParent(this);
return;
}
***************
*** 327,330 ****
--- 327,350 ----
/// <summary>
+ /// Determines if the given control has a visible parent control that is not
+ /// of type RenderedByScriptControl.
+ /// </summary>
+ /// <remarks>
+ /// It's used to determine whether the control is rendered on page or not.
+ /// </remarks>
+ /// <param name="control"></param>
+ /// <returns></returns>
+ private bool HasVisibleNotRenderedByScriptParent(Control control)
+ {
+ if (control.Parent == null || control.Parent == control.Page)
+ return true;
+
+ if (control.Parent is RenderedByScriptControl)
+ return HasVisibleNotRenderedByScriptParent(control.Parent);
+ else
+ return control.Parent.Visible;
+ }
+
+ /// <summary>
/// Finds the next visible control of the control collection of this
/// control's parent that has its ID attribute set.
|