From: Argiris K. <be...@us...> - 2005-11-17 15:03:25
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23052/Core/UI Modified Files: AjaxControl.cs AjaxPage.cs AjaxUserControl.cs RenderedByScriptControl.cs Log Message: Server.Transfer is working for 'NoStore' mode. Exceptions thrown during page processing are handled properly. Improvements for 'Storing' page modes (NoVerifyRenderingPage is not required) Fixed various problems that RBS_Control_Store was causing. Index: AjaxUserControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxUserControl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxUserControl.cs 16 Nov 2005 08:08:58 -0000 1.3 --- AjaxUserControl.cs 17 Nov 2005 15:03:16 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- using System; using System.Web; + using System.ComponentModel; namespace MagicAjax.UI *************** *** 50,53 **** --- 51,63 ---- } + /// <summary> + /// Determines if the control is being processed during an AjaxCall. + /// </summary> + [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsAjaxCall + { + get { return AjaxCallHelper.IsAjaxCallForPage(this.Page); } + } + protected virtual void OnAjaxCall(EventArgs e) { Index: AjaxPage.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxPage.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxPage.cs 16 Nov 2005 08:08:58 -0000 1.3 --- AjaxPage.cs 17 Nov 2005 15:03:16 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- using System; using System.Web; + using System.ComponentModel; namespace MagicAjax.UI *************** *** 50,53 **** --- 51,63 ---- } + /// <summary> + /// Determines if the page is being processed during an AjaxCall. + /// </summary> + [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool IsAjaxCall + { + get { return AjaxCallHelper.IsAjaxCallForPage(this); } + } + protected virtual void OnAjaxCall(EventArgs e) { Index: AjaxControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxControl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxControl.cs 15 Nov 2005 14:07:31 -0000 1.3 --- AjaxControl.cs 17 Nov 2005 15:03:16 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- using System; + using System.Web; using System.Web.UI; using System.Web.UI.WebControls; *************** *** 45,51 **** } public bool IsPageNoStoreMode { ! get { return (MagicAjaxModule.Instance.Configuration.PageStore.Mode == Configuration.PageStoreMode.NoStore); } } --- 46,62 ---- } + [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsPageNoStoreMode { ! get { return AjaxCallHelper.IsPageNoStoreMode; } ! } ! ! /// <summary> ! /// Determines if the control is being processed during an AjaxCall. ! /// </summary> ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsAjaxCall ! { ! get { return AjaxCallHelper.IsAjaxCallForPage(this.Page); } } Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RenderedByScriptControl.cs 16 Nov 2005 22:54:31 -0000 1.3 --- RenderedByScriptControl.cs 17 Nov 2005 15:03:16 -0000 1.4 *************** *** 89,93 **** set { ! if ( AjaxCallHelper.IsAjaxCall && IsRenderedOnPage && MonitorVisibilityState --- 89,93 ---- set { ! if ( IsAjaxCall && IsRenderedOnPage && MonitorVisibilityState *************** *** 175,203 **** if (!IsChildOfRenderedByScriptControl(this)) { ! if (IsPageNoStoreMode) ! { ! // Firefox keeps the form data of a page when doing a page reload or using ! // the back/forward button. ! // However, the 'RenderedByScriptControls' will disappear after a reload. ! // To redraw these controls on the page, we will force a callback from the client's ! // window.onload when the value of hidden field '__RBSCONTROLSEXIST' ! // equals '1'. This hidden field is set to '1' whenever a callback is made. ! // On first page rendering, the value of this hidden field is '0'. ! // Internet Explorer always resets all form data on a page refresh (also the hidden ! // field '__RBSCONTROLSEXIST'), so for IE no extra callback will be forced. ! Page.RegisterHiddenField("__RBSCONTROLSEXIST", "0"); ! } ! else ! { ! // 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". ! // To resolve this, the name of the storing fields is different for ! // each page request. ! string hiddenStore = this.ClientID + "$RBS_Store" + DateTime.Now.Ticks; ! Page.RegisterHiddenField(hiddenStore, null); ! Page.RegisterArrayDeclaration("RBS_Controls", String.Format("document.all[\"{0}$RBS_Holder\"]", this.ClientID)); ! Page.RegisterArrayDeclaration("RBS_Controls_Store", String.Format("document.all[\"{0}\"]", hiddenStore)); ! } } base.OnPreRender (e); --- 175,187 ---- if (!IsChildOfRenderedByScriptControl(this)) { ! // 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. ! string hiddenStore = this.ClientID + "$RBS_Store"; ! Page.RegisterHiddenField(hiddenStore, null); ! Page.RegisterArrayDeclaration("RBS_Controls", String.Format("document.all[\"{0}$RBS_Holder\"]", this.ClientID)); ! Page.RegisterArrayDeclaration("RBS_Controls_Store", String.Format("document.all[\"{0}\"]", hiddenStore)); } base.OnPreRender (e); |