From: Argiris K. <be...@us...> - 2005-11-22 00:59:30
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10664/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: More testing revealed that an AjaxPanel that is invisible and not contained inside another AjaxPanel, cannot be made visible during AjaxCall correctly. To spare developers the confusion, an exception is thrown when this situation occurs. Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RenderedByScriptControl.cs 21 Nov 2005 12:18:37 -0000 1.10 --- RenderedByScriptControl.cs 22 Nov 2005 00:59:22 -0000 1.11 *************** *** 267,278 **** { // Put the control's tag on page ! ! base.RenderBeginTag (strwriter); ! _currentTagHtml = sb.ToString(); ! base.RenderEndTag (strwriter); ! string html = sb.ToString(); ! ! Control con = FindNextVisibleSibling(); ! AjaxCallHelper.WriteAddElementScript (Parent.ClientID, "Span", String.Empty, html, (con == null) ? null : con.ClientID); } else --- 267,271 ---- { // Put the control's tag on page ! PutTagOnPageForAjaxCall(); } else *************** *** 301,304 **** --- 294,311 ---- /// <summary> + /// Called when the control gets visible during AjaxCall and is not already + /// rendered on page. + /// </summary> + /// <remarks> + /// RenderedByScriptControl's method throws an exception because it doesn't know + /// where to put the tag. An inheriting control should override this method + /// to provide the appropriate functionality. + /// </remarks> + protected virtual void PutTagOnPageForAjaxCall() + { + throw new MagicAjaxException(String.Format("RenderByScript control '{0}' cannot get visible during an AjaxCall.", this.ClientID)); + } + + /// <summary> /// Gets the top control that has its Visible property set to false. /// </summary> |