Update of /cvsroot/magicajax/magicajax/Core/UI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2251/Core/UI
Modified Files:
RenderedByScriptControl.cs
Log Message:
Replaced RBS_Control_Stores with a single field storing the form's html.
Added 'tracing' configuration option, used to monitor the traffic of AjaxCalls.
Added a check that does not enable MagicAjax for browsers other than IE and Firefox.
Index: RenderedByScriptControl.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** RenderedByScriptControl.cs 20 Nov 2005 08:47:29 -0000 1.9
--- RenderedByScriptControl.cs 21 Nov 2005 12:18:37 -0000 1.10
***************
*** 188,232 ****
}
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad (e);
-
- if (!IsChildOfRenderedByScriptControl(this))
- {
- string hiddenStore;
-
- if ( IsPageNoStoreMode )
- {
- // Firefox, when performing a refresh, loads the page but keeps any INPUT
- // field values. Thus, the html of a RenderedByScriptControl is restored
- // as if the page was loaded because of the browser's "Back Button".
- // We cannot avoid this because Firefox also keeps any changes that occured
- // to ViewState, so we need the controls to keep their changes.
- hiddenStore = this.ClientID + "$RBS_Store";
- }
- else
- {
- // At storing modes we don't mess with the ViewState field, so use
- // a different name for the hidden field at each page request so that
- // it can be reset for Firefox's "Refresh".
- hiddenStore = this.ClientID + "$RBS_Store" + DateTime.Now.Ticks;
- }
-
- Page.RegisterHiddenField(hiddenStore, null);
- Page.RegisterArrayDeclaration("RBS_ControlIDs", String.Format("\"{0}$RBS_Holder\"", this.ClientID));
- Page.RegisterArrayDeclaration("RBS_Controls_Store", String.Format("document.all[\"{0}\"]", hiddenStore));
- }
- }
-
- protected bool IsChildOfRenderedByScriptControl(Control control)
- {
- if (control.Parent == null || control.Parent == control.Page)
- return false;
- else if (control.Parent is RenderedByScriptControl)
- return true;
- else
- return IsChildOfRenderedByScriptControl(control.Parent);
- }
-
/// <summary>
/// Normal rendering.
--- 188,191 ----
***************
*** 247,256 ****
if ( !IsAjaxCall || (writer.InnerWriter is IScriptRenderingDisabler && (writer.InnerWriter as IScriptRenderingDisabler).DisableScriptRendering) )
{
- // Put the html of this control inside a SPAN tag so that it can
- // be saved and restored when the page is loaded from the Browser's cache,
- // i.e. when the back button is pressed.
- writer.Write("<span id='{0}$RBS_Holder'>", this.ClientID);
base.Render (writer);
- writer.Write("</span>");
_isHtmlRendered = true;
--- 206,210 ----
***************
*** 312,316 ****
if ( ! IsRenderedOnPage )
{
! // Put the control's tag on page, inside a RBS_Holder span.
base.RenderBeginTag (strwriter);
--- 266,270 ----
if ( ! IsRenderedOnPage )
{
! // Put the control's tag on page
base.RenderBeginTag (strwriter);
***************
*** 320,324 ****
Control con = FindNextVisibleSibling();
! AjaxCallHelper.WriteAddElementScript (Parent.ClientID, "Span", this.ClientID + "$RBS_Holder", html, (con == null) ? null : con.ClientID);
}
else
--- 274,278 ----
Control con = FindNextVisibleSibling();
! AjaxCallHelper.WriteAddElementScript (Parent.ClientID, "Span", String.Empty, html, (con == null) ? null : con.ClientID);
}
else
|