You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(204) |
Dec
(147) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(52) |
Feb
(33) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Argiris K. <be...@us...> - 2005-11-18 18:53:16
|
Update of /cvsroot/magicajax/magicajax/CustomControls/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20616/CustomControls/UI/Controls Modified Files: AjaxCascadeTable.cs AjaxLinkedPanelListControl.cs AjaxTabbedPanel.cs Log Message: Changed 'MagicAjax library' to 'framework' as this is more appropriate. Fixed a bug of ExtendedRendering for 'NoStore'. Index: AjaxTabbedPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/CustomControls/UI/Controls/AjaxTabbedPanel.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AjaxTabbedPanel.cs 16 Nov 2005 13:39:14 -0000 1.2 --- AjaxTabbedPanel.cs 18 Nov 2005 18:53:08 -0000 1.3 *************** *** 1,5 **** #region LGPL License /* ! MagicAjax Library Copyright (C) 2005 MagicAjax Project Team --- 1,5 ---- #region LGPL License /* ! MagicAjax.NET Framework Copyright (C) 2005 MagicAjax Project Team Index: AjaxLinkedPanelListControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/CustomControls/UI/Controls/AjaxLinkedPanelListControl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxLinkedPanelListControl.cs 17 Nov 2005 15:03:16 -0000 1.3 --- AjaxLinkedPanelListControl.cs 18 Nov 2005 18:53:08 -0000 1.4 *************** *** 1,5 **** #region LGPL License /* ! MagicAjax Library Copyright (C) 2005 MagicAjax Project Team --- 1,5 ---- #region LGPL License /* ! MagicAjax.NET Framework Copyright (C) 2005 MagicAjax Project Team Index: AjaxCascadeTable.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/CustomControls/UI/Controls/AjaxCascadeTable.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AjaxCascadeTable.cs 16 Nov 2005 13:39:14 -0000 1.2 --- AjaxCascadeTable.cs 18 Nov 2005 18:53:08 -0000 1.3 *************** *** 1,5 **** #region LGPL License /* ! MagicAjax Library Copyright (C) 2005 MagicAjax Project Team --- 1,5 ---- #region LGPL License /* ! MagicAjax.NET Framework Copyright (C) 2005 MagicAjax Project Team |
From: Argiris K. <be...@us...> - 2005-11-18 18:53:15
|
Update of /cvsroot/magicajax/magicajax/Core/Collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20616/Core/Collections Modified Files: ReadOnlyArrayList.cs Log Message: Changed 'MagicAjax library' to 'framework' as this is more appropriate. Fixed a bug of ExtendedRendering for 'NoStore'. Index: ReadOnlyArrayList.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Collections/ReadOnlyArrayList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReadOnlyArrayList.cs 11 Nov 2005 06:17:49 -0000 1.1 --- ReadOnlyArrayList.cs 18 Nov 2005 18:53:07 -0000 1.2 *************** *** 1,5 **** #region LGPL License /* ! MagicAjax Library Copyright (C) 2005 MagicAjax Project Team --- 1,5 ---- #region LGPL License /* ! MagicAjax.NET Framework Copyright (C) 2005 MagicAjax Project Team |
From: Dion O. <dol...@us...> - 2005-11-18 17:46:30
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31652/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: NoStore mode now uses regular 'WriteSetHtmlOfElementScript' instead of 'ExtendedWriteSetHtmlOfElementScript' (is only for Session and Cache modes) Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AjaxPanel.cs 18 Nov 2005 10:29:04 -0000 1.11 --- AjaxPanel.cs 18 Nov 2005 17:46:17 -0000 1.12 *************** *** 472,476 **** if (htmlHashCode != (string)_controlHtmlHashes[con]) { ! ExtendedWriteSetHtmlOfElementScript(html, GetAjaxElemID(con)); _controlHtmlHashes[con] = htmlHashCode; } --- 472,476 ---- if (htmlHashCode != (string)_controlHtmlHashes[con]) { ! AjaxCallHelper.WriteSetHtmlOfElementScript(html, GetAjaxElemID(con)); _controlHtmlHashes[con] = htmlHashCode; } |
From: Dion O. <dol...@us...> - 2005-11-18 17:46:25
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31652/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: NoStore mode now uses regular 'WriteSetHtmlOfElementScript' instead of 'ExtendedWriteSetHtmlOfElementScript' (is only for Session and Cache modes) Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AjaxCallObject.js 18 Nov 2005 10:29:04 -0000 1.7 --- AjaxCallObject.js 18 Nov 2005 17:46:17 -0000 1.8 *************** *** 483,487 **** } ! // It's used by AjaxPanel AjaxCallObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { --- 483,487 ---- } ! // It's used by AjaxPanel Session and Cache mode AjaxCallObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { |
From: Argiris K. <be...@us...> - 2005-11-18 16:04:24
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6859/Core Modified Files: MagicAjaxModule.cs Log Message: Session/Cache storing modes will throw exception when used for NET 2.0 Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MagicAjaxModule.cs 18 Nov 2005 16:01:30 -0000 1.13 --- MagicAjaxModule.cs 18 Nov 2005 16:04:15 -0000 1.14 *************** *** 187,191 **** { // Store the page object ! if ( ! page.Request.Browser.Crawler && page.Request.Browser.JavaScript) { --- 187,193 ---- { // Store the page object ! #if NET_2_0 ! throw new MagicAjaxException("Session/Cache page storing modes are not supported for .NET 2.0 framework."); ! #endif if ( ! page.Request.Browser.Crawler && page.Request.Browser.JavaScript) { *************** *** 573,580 **** Util.SetPrivateField (_currentPageInfo.Page, typeof(Page), "_inOnFormRender", true); - #if NET_2_0 - Util.CallPrivateMethod (_currentPageInfo.Page, typeof(Page), "OnInit", EventArgs.Empty); - #endif - if ( _currentPageInfo.Page.Validators.Count == 0 ) { --- 575,578 ---- *************** *** 596,605 **** ProcessAjaxCall(_currentPageInfo.Page); } ! catch (System.Threading.ThreadAbortException exc) { // ThreadAbortException is for Server.Transfer, Response.Redirect // and AjaxCallHelper.End _exceptionThrown = false; ! throw exc; } --- 594,603 ---- ProcessAjaxCall(_currentPageInfo.Page); } ! catch (System.Threading.ThreadAbortException) { // ThreadAbortException is for Server.Transfer, Response.Redirect // and AjaxCallHelper.End _exceptionThrown = false; ! throw; } |
From: Argiris K. <be...@us...> - 2005-11-18 16:01:38
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6207/Core Modified Files: MagicAjaxModule.cs Log Message: Session/Cache storing modes will throw exception if used for NET 2.0 Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MagicAjaxModule.cs 18 Nov 2005 10:29:03 -0000 1.12 --- MagicAjaxModule.cs 18 Nov 2005 16:01:30 -0000 1.13 *************** *** 480,489 **** _context.Handler.ProcessRequest (_context); } ! catch (System.Threading.ThreadAbortException exc) { // ThreadAbortException is for Server.Transfer, Response.Redirect // and AjaxCallHelper.End _exceptionThrown = false; ! throw exc; } --- 480,489 ---- _context.Handler.ProcessRequest (_context); } ! catch (System.Threading.ThreadAbortException) { // ThreadAbortException is for Server.Transfer, Response.Redirect // and AjaxCallHelper.End _exceptionThrown = false; ! throw; } *************** *** 573,576 **** --- 573,580 ---- Util.SetPrivateField (_currentPageInfo.Page, typeof(Page), "_inOnFormRender", true); + #if NET_2_0 + Util.CallPrivateMethod (_currentPageInfo.Page, typeof(Page), "OnInit", EventArgs.Empty); + #endif + if ( _currentPageInfo.Page.Validators.Count == 0 ) { |
From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core/Configuration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core/Configuration Modified Files: MagicAjaxConfiguration.cs Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: MagicAjaxConfiguration.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Configuration/MagicAjaxConfiguration.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MagicAjaxConfiguration.cs 14 Nov 2005 18:50:43 -0000 1.2 --- MagicAjaxConfiguration.cs 18 Nov 2005 10:29:04 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- { private PageStoreMode _mode; + private bool _unloadStoredPage; private int _cacheTimeout; private int _maxConcurrentPages; *************** *** 25,28 **** --- 26,34 ---- } + public bool UnloadStoredPage + { + get { return _unloadStoredPage; } + } + public int CacheTimeout { *************** *** 40,44 **** } ! public PageStore(PageStoreMode mode, int cacheTimeout, int maxConcurrentPages, bool maxPagesLimitAlert) { _mode = mode; --- 46,50 ---- } ! public PageStore(PageStoreMode mode, bool unloadStoredPage, int cacheTimeout, int maxConcurrentPages, bool maxPagesLimitAlert) { _mode = mode; *************** *** 46,49 **** --- 52,56 ---- _maxConcurrentPages = maxConcurrentPages; _maxPagesLimitAlert = maxPagesLimitAlert; + _unloadStoredPage = unloadStoredPage; } } *************** *** 72,75 **** --- 79,83 ---- _scriptPath = null; // Null implicates that the embedded javascripts will be used (default) PageStoreMode mode = PageStoreMode.NoStore; + bool unloadStoredPage = false; int cacheTimeout = 5; int maxPages = 5; *************** *** 105,108 **** --- 113,129 ---- } + attrib = (XmlAttribute)pageStore.Attributes.GetNamedItem("unloadStoredPage"); + if (attrib != null) + { + try + { + unloadStoredPage = bool.Parse(attrib.Value); + } + catch + { + throw new ConfigurationException("MagicAjax configuration: unloadStoredPage for pageStore must be boolean."); + } + } + attrib = (XmlAttribute)pageStore.Attributes.GetNamedItem("cacheTimeout"); if (attrib != null) *************** *** 149,153 **** } ! _pageStore = new PageStore(mode, cacheTimeout, maxPages, maxPagesLimitAlert); } } --- 170,174 ---- } ! _pageStore = new PageStore(mode, unloadStoredPage, cacheTimeout, maxPages, maxPagesLimitAlert); } } |
From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core Modified Files: AjaxCallHelper.cs MagicAjaxModule.cs Util.cs Web.config Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: Web.config =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Web.config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Web.config 14 Nov 2005 18:50:43 -0000 1.2 --- Web.config 18 Nov 2005 10:29:03 -0000 1.3 *************** *** 11,21 **** If omitted, the embedded "AjaxCallObject.js" file is used (default). example: <magicAjax ajaxCallScriptPath="~/script" /> ! pageStore/mode - "NoStore" : Doesn't keep the page object, it is recreated for each AjaxCall "Session" : Saves the page object in session, works only for "InProc" SessionState "Cache" : Saves the page object in cache Default is "NoStore" pageStore/cacheTimeout - The time in minutes that the page will be kept in cache, if "Cache" is selected for pageStore. Default is 5 ! pageStore/maxConcurrentPages - if the page is stored (mode is not "NoStore") it defines the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages --- 11,26 ---- If omitted, the embedded "AjaxCallObject.js" file is used (default). example: <magicAjax ajaxCallScriptPath="~/script" /> ! pageStore/mode - "NoStore" : Doesn't store the page object, it is recreated for each AjaxCall "Session" : Saves the page object in session, works only for "InProc" SessionState "Cache" : Saves the page object in cache Default is "NoStore" + pageStore/unloadStoredPage - "false" : if the page is stored (mode is "Session" or "Cache") + the page object is kept until session or cache expires + "true : An AjaxCall is invoked at the unload event of the + client's page for the server to drop the stored page object. + Default is "false" pageStore/cacheTimeout - The time in minutes that the page will be kept in cache, if "Cache" is selected for pageStore. Default is 5 ! pageStore/maxConcurrentPages - if the page is stored (mode is "Session" or "Cache") it defines the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages *************** *** 24,27 **** --- 29,33 ---- <pageStore mode="NoStore" + unloadStoredPage="false" cacheTimeout="5" maxConcurrentPages="5" Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AjaxCallHelper.cs 17 Nov 2005 15:03:16 -0000 1.4 --- AjaxCallHelper.cs 18 Nov 2005 10:29:03 -0000 1.5 *************** *** 25,29 **** using System.Web.UI; using System.Collections; - using System.Security.Cryptography; using System.Text; --- 25,28 ---- *************** *** 299,315 **** return url; } - - /// <summary> - /// Create a base64 encoded MD5 sum string of an input string - /// </summary> - /// <param name="str"></param> - /// <returns></returns> - static public string GetBase64MD5Sum(string input) - { - byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); - byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); - return Convert.ToBase64String(hashedBytes); - } - #endregion --- 298,301 ---- Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Util.cs 17 Nov 2005 20:15:38 -0000 1.2 --- Util.cs 18 Nov 2005 10:29:03 -0000 1.3 *************** *** 2,5 **** --- 2,7 ---- using System.Collections; using System.Web.UI; + using System.Security.Cryptography; + using System.Text; namespace MagicAjax *************** *** 11,14 **** --- 13,28 ---- { /// <summary> + /// Create a base64 encoded MD5 sum string of an input string + /// </summary> + /// <param name="str"></param> + /// <returns></returns> + static public string GetBase64MD5Sum(string input) + { + byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); + byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); + return Convert.ToBase64String(hashedBytes); + } + + /// <summary> /// Call a private method from the given object. /// </summary> Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MagicAjaxModule.cs 17 Nov 2005 18:10:01 -0000 1.11 --- MagicAjaxModule.cs 18 Nov 2005 10:29:03 -0000 1.12 *************** *** 150,154 **** alert(""Unable to find script library '{0}/{1}'. Copy the file to the required location, or change the 'ajaxCallScriptPath' setting at magicAjax section of web.config.""); else ! AJAXCbo.HookAjaxCall({2}); </script>"; --- 150,154 ---- alert(""Unable to find script library '{0}/{1}'. Copy the file to the required location, or change the 'ajaxCallScriptPath' setting at magicAjax section of web.config.""); else ! AJAXCbo.HookAjaxCall({2},{3}); </script>"; *************** *** 181,185 **** bool pageIsStored = (_config.PageStore.Mode != PageStoreMode.NoStore); ! page.RegisterStartupScript( "AJAXCALL_HOOK", String.Format(STARTUP_SCRIPT_FORMAT, location, "AjaxCallObject.js", pageIsStored.ToString().ToLower())); if ( pageIsStored ) --- 181,186 ---- bool pageIsStored = (_config.PageStore.Mode != PageStoreMode.NoStore); ! bool unloadStoredPage = _config.PageStore.UnloadStoredPage; ! page.RegisterStartupScript( "AJAXCALL_HOOK", String.Format(STARTUP_SCRIPT_FORMAT, location, "AjaxCallObject.js", pageIsStored.ToString().ToLower(), unloadStoredPage.ToString().ToLower())); if ( pageIsStored ) *************** *** 535,542 **** if (_currentPageInfo == null) { ! // Stored Page wasn't found, could be that the session expired. ! // Have the browser do a refresh. ! // It will stop the current execution and will throw Application_EndRequest event ! AjaxCallHelper.Redirect (_request.RawUrl); } --- 536,550 ---- if (_currentPageInfo == null) { ! if ( _isAjaxCall ) ! { ! // Stored Page wasn't found, could be that the session expired. ! // Have the browser do a refresh. ! // It will stop the current execution and will throw Application_EndRequest event ! AjaxCallHelper.Redirect (_request.RawUrl); ! } ! else ! { ! return; ! } } |
From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core/UI Modified Files: RenderedByScriptControl.cs Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RenderedByScriptControl.cs 17 Nov 2005 15:03:16 -0000 1.4 --- RenderedByScriptControl.cs 18 Nov 2005 10:29:04 -0000 1.5 *************** *** 175,184 **** 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)); --- 175,197 ---- 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_Controls", String.Format("document.all[\"{0}$RBS_Holder\"]", this.ClientID)); |
From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core/script Modified Files: AjaxCallObject.js Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AjaxCallObject.js 17 Nov 2005 15:28:17 -0000 1.6 --- AjaxCallObject.js 18 Nov 2005 10:29:04 -0000 1.7 *************** *** 59,63 **** } ! AjaxCallObject.prototype.HookAjaxCall = function(bPageIsStored) { __PreviousOnFormSubmit = document.forms[0].onsubmit; --- 59,63 ---- } ! AjaxCallObject.prototype.HookAjaxCall = function(bPageIsStored, bUnloadStoredPage) { __PreviousOnFormSubmit = document.forms[0].onsubmit; *************** *** 78,88 **** } ! __PreviousOnPageLoad = window.onload; ! window.onload = this.OnPageLoad; ! __PreviousOnPageBeforeUnload = window.onbeforeunload; ! window.onbeforeunload = this.OnPageBeforeUnload; ! if (bPageIsStored) { __PreviousOnPageUnload = window.onunload; --- 78,91 ---- } ! if ( !bPageIsStored || !bUnloadStoredPage ) ! { ! __PreviousOnPageLoad = window.onload; ! window.onload = this.OnPageLoad; ! __PreviousOnPageBeforeUnload = window.onbeforeunload; ! window.onbeforeunload = this.OnPageBeforeUnload; ! } ! if ( bPageIsStored && bUnloadStoredPage ) { __PreviousOnPageUnload = window.onunload; |
From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AjaxPanel.cs 17 Nov 2005 15:11:46 -0000 1.10 --- AjaxPanel.cs 18 Nov 2005 10:29:04 -0000 1.11 *************** *** 184,188 **** if (IsPageNoStoreMode) ! _controlHtmlHashes[control] = AjaxCallHelper.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[control] = sb.ToString(); --- 184,188 ---- if (IsPageNoStoreMode) ! _controlHtmlHashes[control] = Util.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[control] = sb.ToString(); *************** *** 290,294 **** if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = AjaxCallHelper.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); --- 290,294 ---- if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = Util.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); *************** *** 409,413 **** if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = AjaxCallHelper.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); --- 409,413 ---- if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = Util.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); *************** *** 452,456 **** if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = AjaxCallHelper.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); --- 452,456 ---- if (IsPageNoStoreMode) ! _controlHtmlHashes[con] = Util.GetBase64MD5Sum(sb.ToString()); else _controlHtmls[con] = sb.ToString(); *************** *** 467,471 **** if (IsPageNoStoreMode) { ! string htmlHashCode = AjaxCallHelper.GetBase64MD5Sum(html); // If it's html rendering sha1 hash is the same, ignore it. --- 467,471 ---- if (IsPageNoStoreMode) { ! string htmlHashCode = Util.GetBase64MD5Sum(html); // If it's html rendering sha1 hash is the same, ignore it. |
From: Dion O. <dol...@us...> - 2005-11-17 20:15:46
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29402/magicajax/Core Modified Files: Util.cs Log Message: Added a array of types from the input parameters for getting a private method. This solves the 'System.Reflection.AmbiguousMatchException' for .NET 2.0 Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Util.cs 17 Nov 2005 15:06:31 -0000 1.1 --- Util.cs 17 Nov 2005 20:15:38 -0000 1.2 *************** *** 18,24 **** /// <param name="parameters"></param> /// <returns></returns> ! public static object CallPrivateMethod (object instance, Type type, string methodName, params object[] parameters) { ! return type.GetMethod(methodName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(instance, parameters); } --- 18,24 ---- /// <param name="parameters"></param> /// <returns></returns> ! public static object CallPrivateMethod(object instance, Type type, string methodName, params object[] parameters) { ! return type.GetMethod(methodName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic, null, GetTypesOfParameters(parameters), null).Invoke(instance, parameters); } *************** *** 52,55 **** --- 52,74 ---- } + /// <summary> + /// Returns an array of types from the input object array + /// </summary> + /// <param name="parameters"></param> + /// <returns></returns> + private static Type[] GetTypesOfParameters(object[] parameters) + { + if (parameters != null) + { + Type[] types = new Type[parameters.Length]; + for (int i = 0; i < parameters.Length; i++) + { + types[i] = parameters[i].GetType(); + } + return types; + } + return null; + } + private Util() { |
From: Argiris K. <be...@us...> - 2005-11-17 18:10:13
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18730/Core Modified Files: MagicAjaxModule.cs Log Message: Hacky stuff for 'Storing' page modes to provide the ViewState for a normal PostBack. Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MagicAjaxModule.cs 17 Nov 2005 15:03:16 -0000 1.10 --- MagicAjaxModule.cs 17 Nov 2005 18:10:01 -0000 1.11 *************** *** 543,548 **** if ( ! _isAjaxCall ) { ! // PostBack. Get the controls from stored page. ! requestPage.Init += new EventHandler(RequestedPage_Init); } else --- 543,555 ---- if ( ! _isAjaxCall ) { ! // PostBack. Do some really hacky stuff to get the real viewstate. ! ! string vs = GetViewStateOfPage(_currentPageInfo.Page); ! if (vs != null) ! { ! Util.SetPrivateField(_request.Form, typeof(NameObjectCollectionBase), "_readOnly", false); ! _request.Form["__VIEWSTATE"] = vs; ! Util.SetPrivateField(_request.Form, typeof(NameObjectCollectionBase), "_readOnly", true); ! } } else *************** *** 553,563 **** _response.Filter = _filter; ! if (_currentPageInfo.AjaxCallsCount == 0 ! && _currentPageInfo.Page.Validators.Count == 0) { ! // Restore the validators ! ArrayList validators = Util.GetChildControlsOfType(_currentPageInfo.Page, typeof(IValidator), false); ! foreach (IValidator valid in validators) ! _currentPageInfo.Page.Validators.Add (valid); } --- 560,575 ---- _response.Filter = _filter; ! if ( _currentPageInfo.AjaxCallsCount == 0 ) { ! // For bypassing the VerifyRenderingInServerForm check ! Util.SetPrivateField (_currentPageInfo.Page, typeof(Page), "_inOnFormRender", true); ! ! if ( _currentPageInfo.Page.Validators.Count == 0 ) ! { ! // Restore the validators ! ArrayList validators = Util.GetChildControlsOfType(_currentPageInfo.Page, typeof(IValidator), false); ! foreach (IValidator valid in validators) ! _currentPageInfo.Page.Validators.Add (valid); ! } } *************** *** 585,594 **** } - protected virtual void RequestedPage_Init(object sender, EventArgs e) - { - // TODO: Replace the controls of AjaxControls from requestedPage with controls from stored page. - return; - } - /// <summary> /// Handles the EndRequest event of the Application --- 597,600 ---- *************** *** 632,637 **** // Required for Page.Request/Page.Response to be valid Util.CallPrivateMethod (page, typeof(Page), "SetIntrinsics", _context); - // For bypassing the VerifyRenderingInServerForm check - Util.SetPrivateField (page, typeof(Page), "_inOnFormRender", true); ReadOnlyArrayList postDataChangedControls; --- 638,641 ---- *************** *** 806,809 **** --- 810,838 ---- ((IPostBackEventHandler)eventcontrol).RaisePostBackEvent(eventArgument); } + + /// <summary> + /// Hacky way to get the ViewState field value of a page. + /// </summary> + /// <param name="page"></param> + /// <returns></returns> + protected virtual string GetViewStateOfPage (Page page) + { + #if NET_2_0 + // TODO: Write the hacky way to get ViewState for NET 2.0 too. + return null; + #else + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + HtmlTextWriter writer = new HtmlTextWriter(new System.IO.StringWriter(sb)); + + Util.SetPrivateField(page, typeof(Page), "_fOnFormRenderCalled", false); + Util.CallPrivateMethod(page, typeof(Page), "SavePageViewState"); + Util.CallPrivateMethod(page, typeof(Page), "OnFormRender", writer, String.Empty); + + string html = sb.ToString(); + int si = html.IndexOf("value=\"") + 7; + int ei = html.IndexOf('\"', si); + return html.Substring(si, ei - si); + #endif + } #endregion |
From: Dion O. <dol...@us...> - 2005-11-17 15:28:27
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29704/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: Minor fix: OnPageUnload code (for unloading stored pages) is now only run for bPageIsStored pages Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AjaxCallObject.js 17 Nov 2005 15:03:16 -0000 1.5 --- AjaxCallObject.js 17 Nov 2005 15:28:17 -0000 1.6 *************** *** 84,89 **** window.onbeforeunload = this.OnPageBeforeUnload; ! __PreviousOnPageUnload = window.onunload; ! window.onunload = this.OnPageUnload; } --- 84,92 ---- window.onbeforeunload = this.OnPageBeforeUnload; ! if (bPageIsStored) ! { ! __PreviousOnPageUnload = window.onunload; ! window.onunload = this.OnPageUnload; ! } } |
From: Dion O. <dol...@us...> - 2005-11-17 15:11:54
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Minor change: Changed the name of the hidden inputbox containing the control fingerprints Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AjaxPanel.cs 17 Nov 2005 15:03:16 -0000 1.9 --- AjaxPanel.cs 17 Nov 2005 15:11:46 -0000 1.10 *************** *** 755,759 **** public static ControlCollectionState LoadState(string panelUniqueID, Control owner) { ! string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); string panelControlStates = HttpContext.Current.Request.Form[panelKey]; if (panelControlStates != null) --- 755,759 ---- public static ControlCollectionState LoadState(string panelUniqueID, Control owner) { ! string panelKey = GetControlFingerprintsField(panelUniqueID); string panelControlStates = HttpContext.Current.Request.Form[panelKey]; if (panelControlStates != null) *************** *** 777,787 **** /// <summary> ! /// Returns the ClientID of the hidden field containing the ControlState hashes for given panel /// </summary> /// <param name="panelUniqueID"></param> /// <returns></returns> ! public static string GetPanelControlStateHiddenFieldID (string panelUniqueID) { ! return string.Format("__AJAXPANELCONTROLSTATE_{0}", panelUniqueID); } --- 777,787 ---- /// <summary> ! /// Returns the ClientID of the hidden field containing the Control fingerprints for given panel /// </summary> /// <param name="panelUniqueID"></param> /// <returns></returns> ! public static string GetControlFingerprintsField(string panelUniqueID) { ! return string.Format("__CONTROL_FINGERPRINTS_{0}", panelUniqueID); } *************** *** 821,825 **** string serializedPanelStateHashes = sbuilder.ToString(); ! string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); if ( AjaxCallHelper.IsAjaxCallForPage(_owner.Page) ) --- 821,825 ---- string serializedPanelStateHashes = sbuilder.ToString(); ! string panelKey = GetControlFingerprintsField(panelUniqueID); if ( AjaxCallHelper.IsAjaxCallForPage(_owner.Page) ) |
From: Argiris K. <be...@us...> - 2005-11-17 15:10:41
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25265/Core Removed Files: NoVerifyRenderingPage.cs Log Message: NoVerifyRenderingPage is not required any more. --- NoVerifyRenderingPage.cs DELETED --- |
From: Argiris K. <be...@us...> - 2005-11-17 15:06:39
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24166/Core Added Files: Util.cs Log Message: Helper methods for the framework. --- NEW FILE: Util.cs --- using System; using System.Collections; using System.Web.UI; namespace MagicAjax { /// <summary> /// Helper methods intented to be used internally be the framework. /// </summary> internal class Util { /// <summary> /// Call a private method from the given object. /// </summary> /// <param name="instance"></param> /// <param name="type"></param> /// <param name="methodName"></param> /// <param name="parameters"></param> /// <returns></returns> public static object CallPrivateMethod (object instance, Type type, string methodName, params object[] parameters) { return type.GetMethod(methodName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(instance, parameters); } public static void SetPrivateField (object instance, Type type, string fieldName, object value) { type.GetField(fieldName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(instance, value); } public static object GetPrivateField (object instance, Type type, string fieldName) { return type.GetField(fieldName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(instance); } public static ArrayList GetChildControlsOfType (Control parentControl, Type type, bool onlyVisible) { ArrayList list = new ArrayList(); for (int i=0; i < parentControl.Controls.Count; i++) { Control con = parentControl.Controls[i]; if (onlyVisible && !con.Visible) continue; if ( type.IsInstanceOfType(con) ) list.Add (con); list.AddRange (GetChildControlsOfType(con, type, onlyVisible)); } return list; } private Util() { } } } |
From: Argiris K. <be...@us...> - 2005-11-17 15:03:27
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23052/Core Modified Files: AjaxCallHelper.cs MagicAjax NET 2.0.csproj MagicAjax.csproj MagicAjaxModule.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: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxCallHelper.cs 15 Nov 2005 12:55:11 -0000 1.3 --- AjaxCallHelper.cs 17 Nov 2005 15:03:16 -0000 1.4 *************** *** 87,90 **** --- 87,98 ---- /// <summary> + /// Determines whether the page is stored or recreated at each AjaxCall. + /// </summary> + public static bool IsPageNoStoreMode + { + get { return (MagicAjaxModule.Instance.Configuration.PageStore.Mode == Configuration.PageStoreMode.NoStore); } + } + + /// <summary> /// Gets the argument string the was sent by the client. /// </summary> *************** *** 167,170 **** --- 175,192 ---- #region Static Methods /// <summary> + /// Determines if the page is being processed during an AjaxCall. + /// </summary> + /// <remarks> + /// When the page is being processed for Server.Transfer, the Page's + /// IsPostBack property will be false. If this is the case IsAjaxCallForPage + /// will return false. + /// </remarks> + public static bool IsAjaxCallForPage (Page page) + { + return (AjaxCallHelper.IsAjaxCall && + ( (IsPageNoStoreMode && page.IsPostBack) || (!IsPageNoStoreMode && MagicAjaxModule.Instance.CurrentPageInfo.Page == page) ) ); + } + + /// <summary> /// Obtains a reference to a client-side script function that causes, when invoked, /// the control to raise an AjaxCall event to the server. This method also passes *************** *** 299,303 **** public static void Redirect(string url) { ! Response.Clear(); Write(String.Format("window.location.href=\"{0}\";\r\n", ResolveUrl(url))); End(); --- 321,325 ---- public static void Redirect(string url) { ! Init(); Write(String.Format("window.location.href=\"{0}\";\r\n", ResolveUrl(url))); End(); Index: MagicAjax NET 2.0.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax NET 2.0.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MagicAjax NET 2.0.csproj 15 Nov 2005 14:07:31 -0000 1.5 --- MagicAjax NET 2.0.csproj 17 Nov 2005 15:03:16 -0000 1.6 *************** *** 124,133 **** <SubType>Code</SubType> </Compile> - <Compile Include="NoVerifyRenderingPage.cs"> - <SubType>ASPXCodeBehind</SubType> - </Compile> <Compile Include="StoredPageInfo.cs"> <SubType>Code</SubType> </Compile> <Compile Include="UI\AjaxControl.cs"> <SubType>Code</SubType> --- 124,133 ---- <SubType>Code</SubType> </Compile> <Compile Include="StoredPageInfo.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Util.cs"> + <SubType>Code</SubType> + </Compile> <Compile Include="UI\AjaxControl.cs"> <SubType>Code</SubType> Index: MagicAjax.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MagicAjax.csproj 14 Nov 2005 18:50:43 -0000 1.2 --- MagicAjax.csproj 17 Nov 2005 15:03:16 -0000 1.3 *************** *** 115,124 **** /> <File ! RelPath = "NoVerifyRenderingPage.cs" ! SubType = "ASPXCodeBehind" BuildAction = "Compile" /> <File ! RelPath = "StoredPageInfo.cs" SubType = "Code" BuildAction = "Compile" --- 115,124 ---- /> <File ! RelPath = "StoredPageInfo.cs" ! SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Util.cs" SubType = "Code" BuildAction = "Compile" Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MagicAjaxModule.cs 16 Nov 2005 08:08:58 -0000 1.9 --- MagicAjaxModule.cs 17 Nov 2005 15:03:16 -0000 1.10 *************** *** 73,76 **** --- 73,77 ---- private MagicAjaxConfiguration _config; private bool _completedAjaxCall; + private bool _exceptionThrown; private PageFilter _filter; private HttpContext _context; *************** *** 95,98 **** --- 96,104 ---- } + public StoredPageInfo CurrentPageInfo + { + get { return _currentPageInfo; } + } + public bool CompletedAjaxCall { *************** *** 137,141 **** public virtual void EnableAjaxOnPage(Page page) { ! if (_isAjaxCall || page == null) return; string STARTUP_SCRIPT_FORMAT = @" --- 143,147 ---- public virtual void EnableAjaxOnPage(Page page) { ! if (page == null || AjaxCallHelper.IsAjaxCallForPage(page)) return; string STARTUP_SCRIPT_FORMAT = @" *************** *** 198,202 **** public virtual void AddWebPartClientFunctions(Page page) { ! if (_isAjaxCall || page == null) return; if (!HttpContext.Current.Items.Contains("AJAX_WEBPARTCLIENTSCRIPT_REGISTERED")) --- 204,208 ---- public virtual void AddWebPartClientFunctions(Page page) { ! if (page == null || AjaxCallHelper.IsAjaxCallForPage(page)) return; if (!HttpContext.Current.Items.Contains("AJAX_WEBPARTCLIENTSCRIPT_REGISTERED")) *************** *** 381,388 **** { case PageStoreMode.Session: ! return (ArrayList)_context.Session[key]; case PageStoreMode.Cache: ! return (ArrayList)_context.Cache[key]; default: --- 387,400 ---- { case PageStoreMode.Session: ! if (_context.Session != null) ! return (ArrayList)_context.Session[key]; ! else ! return null; case PageStoreMode.Cache: ! if (_context.Cache != null) ! return (ArrayList)_context.Cache[key]; ! else ! return null; default: *************** *** 435,438 **** --- 447,451 ---- _isAjaxCall = false; _completedAjaxCall = false; + _exceptionThrown = false; Page requestPage = (Page) _context.Handler; *************** *** 461,465 **** AjaxCallHelper.Init(); ! _context.Handler.ProcessRequest (_context); _response.Flush(); --- 474,490 ---- AjaxCallHelper.Init(); ! try ! { ! _exceptionThrown = true; ! _context.Handler.ProcessRequest (_context); ! } ! catch (System.Threading.ThreadAbortException exc) ! { ! // ThreadAbortException is for Server.Transfer, Response.Redirect ! // and AjaxCallHelper.End ! _exceptionThrown = false; ! throw exc; ! } ! _response.Flush(); *************** *** 518,523 **** if ( ! _isAjaxCall ) { ! // PostBack. Will replace the recreated controls with the stored ones ! requestPage.Load += new EventHandler(RequestedPage_Init); } else --- 543,548 ---- if ( ! _isAjaxCall ) { ! // PostBack. Get the controls from stored page. ! requestPage.Init += new EventHandler(RequestedPage_Init); } else *************** *** 532,556 **** { // Restore the validators ! ArrayList validators = FindValidators(_currentPageInfo.Page); foreach (IValidator valid in validators) _currentPageInfo.Page.Validators.Add (valid); } AjaxCallHelper.Init(); - ProcessAjaxCall(_currentPageInfo.Page); - /* try { ProcessAjaxCall(_currentPageInfo.Page); } ! catch(Exception exc) { ! string hhh = exc.Message; ! int uu=5; ! }*/ ! ! _currentPageInfo.AjaxCallsCount++; ! _currentPageInfo.LastAccess = DateTime.Now; AjaxCallHelper.End(); --- 557,582 ---- { // Restore the validators ! ArrayList validators = Util.GetChildControlsOfType(_currentPageInfo.Page, typeof(IValidator), false); foreach (IValidator valid in validators) _currentPageInfo.Page.Validators.Add (valid); } + _currentPageInfo.AjaxCallsCount++; + _currentPageInfo.LastAccess = DateTime.Now; + AjaxCallHelper.Init(); try { + _exceptionThrown = true; ProcessAjaxCall(_currentPageInfo.Page); } ! catch (System.Threading.ThreadAbortException exc) { ! // ThreadAbortException is for Server.Transfer, Response.Redirect ! // and AjaxCallHelper.End ! _exceptionThrown = false; ! throw exc; ! } AjaxCallHelper.End(); *************** *** 577,581 **** protected virtual void Application_EndRequest(object sender, EventArgs e) { ! if ( ! _isAjaxCall || _completedAjaxCall ) return; --- 603,607 ---- protected virtual void Application_EndRequest(object sender, EventArgs e) { ! if ( ! _isAjaxCall || _completedAjaxCall || _exceptionThrown) return; *************** *** 605,609 **** { // Required for Page.Request/Page.Response to be valid ! CallPrivateMethod (page, typeof(Page), "SetIntrinsics", _context); ReadOnlyArrayList postDataChangedControls; --- 631,637 ---- { // Required for Page.Request/Page.Response to be valid ! Util.CallPrivateMethod (page, typeof(Page), "SetIntrinsics", _context); ! // For bypassing the VerifyRenderingInServerForm check ! Util.SetPrivateField (page, typeof(Page), "_inOnFormRender", true); ReadOnlyArrayList postDataChangedControls; *************** *** 778,825 **** ((IPostBackEventHandler)eventcontrol).RaisePostBackEvent(eventArgument); } - - /// <summary> - /// It finds the validator controls and returns them in an ArrayList. - /// </summary> - /// <remarks> - /// After the normal rendering of the page the Page.Validators collection is empty. - /// This method is used to repopulate it. - /// </remarks> - /// <param name="control"></param> - /// <returns></returns> - protected virtual ArrayList FindValidators (Control control) - { - ArrayList list = new ArrayList(); - - for (int i=0; i < control.Controls.Count; i++) - { - Control con = control.Controls[i]; - - if (con.Visible) - { - if (con is IValidator) - { - list.Add (con); - } - - list.AddRange (FindValidators(con)); - } - } - - return list; - } - - /// <summary> - /// Call a private method from the given object. - /// </summary> - /// <param name="instance"></param> - /// <param name="type"></param> - /// <param name="methodName"></param> - /// <param name="parameters"></param> - /// <returns></returns> - protected object CallPrivateMethod(object instance, Type type, string methodName, params object[] parameters) - { - return type.GetMethod(methodName, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(instance, parameters); - } #endregion --- 806,809 ---- |
From: Argiris K. <be...@us...> - 2005-11-17 15:03:25
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23052/Core/UI/Controls Modified Files: AjaxPanel.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: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AjaxPanel.cs 16 Nov 2005 13:39:14 -0000 1.8 --- AjaxPanel.cs 17 Nov 2005 15:03:16 -0000 1.9 *************** *** 84,89 **** private Hashtable _controlHtmls = new Hashtable(); private Hashtable _controlHtmlHashes = new Hashtable(); ! private NoVerifyRenderingPage _noVerifyPage = new NoVerifyRenderingPage(); ! private ControlCollectionState _controlState = new ControlCollectionState(); #endregion --- 84,88 ---- private Hashtable _controlHtmls = new Hashtable(); private Hashtable _controlHtmlHashes = new Hashtable(); ! private ControlCollectionState _controlState; #endregion *************** *** 99,102 **** --- 98,102 ---- public AjaxPanel() : base(HtmlTextWriterTag.Span) { + _controlState = new ControlCollectionState(this); } #endregion *************** *** 174,179 **** return; - DisableVerifyRendering (true); - System.Text.StringBuilder sb = new System.Text.StringBuilder(); HtmlTextWriter litewriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); --- 174,177 ---- *************** *** 192,197 **** sb.Length = 0; } - - DisableVerifyRendering (false); } #endregion --- 190,193 ---- *************** *** 221,227 **** base.OnLoad (e); - // Enable validation if there is at least one validator. - _noVerifyPage.EnableValidation = (Page.Validators.Count > 0); - if (this.Attributes["AjaxCall"] == null) { --- 217,220 ---- *************** *** 273,277 **** protected override void RenderChildren(HtmlTextWriter writer) { ! if ( AjaxCallHelper.IsAjaxCall && IsPageNoStoreMode ) { LoadControlState(); --- 266,270 ---- protected override void RenderChildren(HtmlTextWriter writer) { ! if ( IsAjaxCall && IsPageNoStoreMode ) { LoadControlState(); *************** *** 280,285 **** else { - DisableVerifyRendering (true); - System.Text.StringBuilder sbFull = new System.Text.StringBuilder(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); --- 273,276 ---- *************** *** 309,314 **** } - DisableVerifyRendering (false); - _addedControls.Clear(); _removedControls.Clear(); --- 300,303 ---- *************** *** 329,333 **** protected virtual void LoadControlState() { ! _controlState = ControlCollectionState.LoadState (this.UniqueID); if (_controlState == null) --- 318,322 ---- protected virtual void LoadControlState() { ! _controlState = ControlCollectionState.LoadState (this.UniqueID, this); if (_controlState == null) *************** *** 392,396 **** protected virtual void DoScriptRendering (HtmlTextWriter output) { ! DisableVerifyRendering (true); System.Text.StringBuilder sb = new System.Text.StringBuilder(); --- 381,386 ---- protected virtual void DoScriptRendering (HtmlTextWriter output) { ! if ( IsAjaxCall && !IsPageNoStoreMode ) ! InitValidators(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); *************** *** 499,504 **** } - DisableVerifyRendering (false); - _addedControls.Clear(); _removedControls.Clear(); --- 489,492 ---- *************** *** 626,680 **** #endregion ! #region DisableVerifyRendering /// <summary> ! /// Disables the verify rendering in server form check. /// </summary> ! /// <remarks> ! /// It disables the verify rendering in server form check of the controls by ! /// setting NoVerifyRenderingPage to their Page property. It enables it again ! /// by setting back the Page of AjaxPanel. ! /// ! /// See the remarks of the NoVerifyRenderingPage class. ! /// </remarks> ! /// <param name="disable">True to set the NoVerifyRenderingPage, false to set the previous page back</param> ! private void DisableVerifyRendering(bool disable) { ! // NoVerifyRenderingPage is used even during normal rendering, ! // so that ':' is used for Unique ID separator instead of '$', ! // thus javascript to convert the Unique IDs of the page won't be sent ! // at the first AjaxCall. ! ! // Try not using DisableVerify at all if it's IsPageNoStoreMode ! if ( this.IsPageNoStoreMode ) ! return; ! ! Page page = (disable) ? _noVerifyPage : this.Page; ! for (int i=0; i < Controls.Count; i++) { ! SetPageForControl(page, Controls[i]); } - } - #endregion - #region SetPageForControl - /// <summary> - /// Sets the supplied page to the Page property of the supplied control and - /// its children. - /// </summary> - /// <remarks> - /// If it encounters a RenderedByScriptControl control, it ignores it. - /// - /// Called by DisableVerifyRendering. - /// </remarks> - /// <param name="page"></param> - /// <param name="control"></param> - private void SetPageForControl(Page page, Control control) - { - if (!(control is RenderedByScriptControl)) - { - control.Page = page; - for (int i=0; i < control.Controls.Count; i++) - SetPageForControl (page, control.Controls[i]); - } } #endregion --- 614,630 ---- #endregion ! #region InitValidators /// <summary> ! /// Clears 'display' and 'visibility' styles from all the validators. /// </summary> ! private void InitValidators() { ! ArrayList valids = Util.GetChildControlsOfType(this, typeof(BaseValidator), true); ! foreach (BaseValidator valid in valids) { ! valid.Style.Remove("display"); ! valid.Style.Remove("visibility"); } } #endregion *************** *** 777,786 **** { private SortedList _controlIDHtmlHashes; /// <summary> /// Default ctor /// </summary> ! public ControlCollectionState() { _controlIDHtmlHashes = new SortedList(); } --- 727,738 ---- { private SortedList _controlIDHtmlHashes; + private Control _owner; /// <summary> /// Default ctor /// </summary> ! public ControlCollectionState(Control owner) { + _owner = owner; _controlIDHtmlHashes = new SortedList(); } *************** *** 790,795 **** /// </summary> /// <param name="controlIDHtmlHashes"></param> ! public ControlCollectionState(SortedList controlIDHtmlHashes) { _controlIDHtmlHashes = controlIDHtmlHashes; } --- 742,748 ---- /// </summary> /// <param name="controlIDHtmlHashes"></param> ! public ControlCollectionState(SortedList controlIDHtmlHashes, Control owner) { + _owner = owner; _controlIDHtmlHashes = controlIDHtmlHashes; } *************** *** 800,804 **** /// <param name="panelUniqueID"></param> /// <returns></returns> ! public static ControlCollectionState LoadState(string panelUniqueID) { string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); --- 753,757 ---- /// <param name="panelUniqueID"></param> /// <returns></returns> ! public static ControlCollectionState LoadState(string panelUniqueID, Control owner) { string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); *************** *** 815,819 **** } ! return new ControlCollectionState(controlIDHtmlHashes); } else --- 768,772 ---- } ! return new ControlCollectionState(controlIDHtmlHashes, owner); } else *************** *** 870,874 **** string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); ! if (AjaxCallHelper.IsAjaxCall) { //if ajax callback, generate javascript to set panelstate's hidden field value --- 823,827 ---- string panelKey = GetPanelControlStateHiddenFieldID(panelUniqueID); ! if ( AjaxCallHelper.IsAjaxCallForPage(_owner.Page) ) { //if ajax callback, generate javascript to set panelstate's hidden field value |
From: Argiris K. <be...@us...> - 2005-11-17 15:03:25
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23052/Core/script Modified Files: AjaxCallObject.js 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: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AjaxCallObject.js 17 Nov 2005 09:02:20 -0000 1.4 --- AjaxCallObject.js 17 Nov 2005 15:03:16 -0000 1.5 *************** *** 6,10 **** __PreviousOnPageBeforeUnload = null; __PreviousOnPageUnload = null; - __RBSExistField = null; function AjaxCallObject() --- 6,9 ---- *************** *** 73,102 **** __bPageIsStored = bPageIsStored; ! // Check if callback should be forced after a browser page reload in FireFox, so all ! // controls rendered by MagicAjax-script will we redrawn on the page. ! __RBSExistField = document.forms[0]["__RBSCONTROLSEXIST"]; ! if (__RBSExistField != null && __RBSExistField.value == '1') { ! //alert('forcing callback for FireFox'); ! AJAXCbo.DoAjaxCall("",""); } ! if (bPageIsStored) ! { ! if (typeof(RBS_Controls) != "undefined") ! { ! for (var i=0; i < RBS_Controls.length; i++) ! RBS_Controls_Store[i].setAttribute("ExcludeFromPost", "true"); ! } ! ! __PreviousOnPageLoad = window.onload; ! window.onload = this.OnPageLoad; ! __PreviousOnPageBeforeUnload = window.onbeforeunload; ! window.onbeforeunload = this.OnPageBeforeUnload; ! __PreviousOnPageUnload = window.onunload; ! window.onunload = this.OnPageUnload; ! } } --- 72,89 ---- __bPageIsStored = bPageIsStored; ! if (typeof(RBS_Controls) != "undefined") { ! for (var i=0; i < RBS_Controls.length; i++) ! RBS_Controls_Store[i].setAttribute("ExcludeFromPost", "true"); } ! __PreviousOnPageLoad = window.onload; ! window.onload = this.OnPageLoad; ! __PreviousOnPageBeforeUnload = window.onbeforeunload; ! window.onbeforeunload = this.OnPageBeforeUnload; ! __PreviousOnPageUnload = window.onunload; ! window.onunload = this.OnPageUnload; } *************** *** 176,180 **** if (html != "") { ! AJAXCbo.RestoreHtml(RBS_Controls[i], decodeURIComponent(html.substring(5, html.length))); RBS_Controls_Store[i].value = ""; } --- 163,167 ---- if (html != "") { ! RBS_Controls[i].innerHTML = decodeURIComponent(html.substring(5, html.length)); RBS_Controls_Store[i].value = ""; } *************** *** 200,203 **** --- 187,193 ---- AjaxCallObject.prototype.OnPageUnload = function() { + if (document.all["__AJAX_PAGEKEY"] == null) + return; + var thePage = document.forms[0].action; var index = thePage.indexOf("?"); *************** *** 356,363 **** waitElement.style.visibility = 'hidden'; - // Set hidden field to indicate callback was done (used for FireFox page redraw on browser page reload) - if (__RBSExistField != null) - __RBSExistField.value = '1'; - return true; } --- 346,349 ---- *************** *** 373,377 **** if (waitElement) waitElement.style.visibility = 'hidden'; ! document.body.innerHTML = responseText; } --- 359,363 ---- if (waitElement) waitElement.style.visibility = 'hidden'; ! document.forms[0].innerHTML = responseText; } *************** *** 425,511 **** } - AjaxCallObject.prototype.RestoreHtml = function(destElem, html) - { - var store = document.createElement("form"); - store.innerHTML = html; - - var scripts = store.getElementsByTagName("script"); - while (scripts.length > 0) - scripts[0].parentNode.removeChild(scripts[0]); - - var elements = new Array(); - var coll = store.getElementsByTagName("INPUT"); - for (var i=0; i < coll.length; i++) - elements.push(coll[i]); - coll = store.getElementsByTagName("TEXTAREA"); - for (var i=0; i < coll.length; i++) - elements.push(coll[i]); - coll = store.getElementsByTagName("SELECT"); - for (var i=0; i < coll.length; i++) - elements.push(coll[i]); - - for( var i=0; i < elements.length; i++ ) - { - var elem = elements[i]; - eName = elem.name; - if( eName && eName != '') - { - var type = elem.type; - var docElem = document.all[elem.id]; - if (docElem == null || docElem.type != type) - continue; - - if ( type == "select-multiple" ) - { - if ( elem.options.length == docElem.options.length ) - { - for (var j=0; j < elem.options.length; j++) - elem.options[j].selected = docElem.options[j].selected; - } - } - else if ( type == "checkbox" || type == "radio" ) - { - elem.checked = docElem.checked; - } - else - { - elem.value = docElem.value; - } - } - } - - destElem.innerHTML = store.innerHTML; - - for( var i=0; i < elements.length; i++ ) - { - var elem = elements[i]; - eName = elem.name; - if( eName && eName != '') - { - var type = elem.type; - var docElem = document.all[elem.id]; - if (docElem == null || docElem.type != type) - continue; - - if ( type == "select-multiple" ) - { - if ( elem.options.length == docElem.options.length ) - { - for (var j=0; j < elem.options.length; j++) - docElem.options[j].selected = elem.options[j].selected; - } - } - else if ( type == "checkbox" || type == "radio" ) - { - docElem.checked = elem.checked; - } - else - { - docElem.value = elem.value; - } - } - } - } - AjaxCallObject.prototype.SetAttributesOfControl = function(clientID, attributes) { --- 411,414 ---- |
From: Argiris K. <be...@us...> - 2005-11-17 15:03:25
|
Update of /cvsroot/magicajax/magicajax/CustomControls/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23052/CustomControls/UI/Controls Modified Files: AjaxLinkedPanelListControl.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: AjaxLinkedPanelListControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/CustomControls/UI/Controls/AjaxLinkedPanelListControl.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AjaxLinkedPanelListControl.cs 14 Nov 2005 18:50:43 -0000 1.2 --- AjaxLinkedPanelListControl.cs 17 Nov 2005 15:03:16 -0000 1.3 *************** *** 126,130 **** protected override void OnPreRender(EventArgs e) { ! if ( !AjaxCallHelper.IsAjaxCall ) { // ÐñÝðåé íá ðñïçãåßôáé ç äÞëùóç ôïõ AjaxCallObject.js --- 126,130 ---- protected override void OnPreRender(EventArgs e) { ! if ( !AjaxCallHelper.IsAjaxCallForPage(this.Page) ) { // ÐñÝðåé íá ðñïçãåßôáé ç äÞëùóç ôïõ AjaxCallObject.js |
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); |
From: Dion O. <dol...@us...> - 2005-11-17 09:02:29
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7952/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: Replaced document.getElementById("__RBSCONTROLSEXIST") by document.forms[0]["__RBSCONTROLSEXIST"] because Firefox couldn't find this hidden element by Id (because it only has a name attribute) Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AjaxCallObject.js 17 Nov 2005 08:44:38 -0000 1.3 --- AjaxCallObject.js 17 Nov 2005 09:02:20 -0000 1.4 *************** *** 75,79 **** // Check if callback should be forced after a browser page reload in FireFox, so all // controls rendered by MagicAjax-script will we redrawn on the page. ! __RBSExistField = document.getElementById("__RBSCONTROLSEXIST"); if (__RBSExistField != null && __RBSExistField.value == '1') { --- 75,79 ---- // Check if callback should be forced after a browser page reload in FireFox, so all // controls rendered by MagicAjax-script will we redrawn on the page. ! __RBSExistField = document.forms[0]["__RBSCONTROLSEXIST"]; if (__RBSExistField != null && __RBSExistField.value == '1') { |
From: Dion O. <dol...@us...> - 2005-11-17 08:44:47
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4731/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: minor fix Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AjaxCallObject.js 16 Nov 2005 22:54:31 -0000 1.2 --- AjaxCallObject.js 17 Nov 2005 08:44:38 -0000 1.3 *************** *** 70,73 **** --- 70,75 ---- __doPostBack = this.DoPostBack; } + + __bPageIsStored = bPageIsStored; // Check if callback should be forced after a browser page reload in FireFox, so all *************** *** 78,82 **** //alert('forcing callback for FireFox'); AJAXCbo.DoAjaxCall("",""); - return; } --- 80,83 ---- *************** *** 98,103 **** window.onunload = this.OnPageUnload; } - - __bPageIsStored = bPageIsStored; } --- 99,102 ---- |
From: Dion O. <dol...@us...> - 2005-11-16 22:54:39
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20348/magicajax/Core/script Modified Files: AjaxCallObject.js Log Message: 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. Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AjaxCallObject.js 14 Nov 2005 18:50:44 -0000 1.1 --- AjaxCallObject.js 16 Nov 2005 22:54:31 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- __PreviousOnPageBeforeUnload = null; __PreviousOnPageUnload = null; + __RBSExistField = null; function AjaxCallObject() *************** *** 63,67 **** __PreviousOnFormSubmit = document.forms[0].onsubmit; document.forms[0].onsubmit = this.OnFormSubmit; ! if (typeof __doPostBack != 'undefined') { --- 64,68 ---- __PreviousOnFormSubmit = document.forms[0].onsubmit; document.forms[0].onsubmit = this.OnFormSubmit; ! if (typeof __doPostBack != 'undefined') { *************** *** 69,121 **** __doPostBack = this.DoPostBack; } ! ! if (typeof(RBS_Controls) != "undefined") { ! for (var i=0; i < RBS_Controls.length; i++) ! RBS_Controls_Store[i].setAttribute("ExcludeFromPost", "true"); } - - __PreviousOnPageLoad = window.onload; - window.onload = - function() - { - // Restore the html of RenderedByScript controls - if (typeof(RBS_Controls) != "undefined") - { - for (var i=0; i < RBS_Controls.length; i++) - { - var html = RBS_Controls_Store[i].value; - if (html != "") - { - AJAXCbo.RestoreHtml(RBS_Controls[i], decodeURIComponent(html.substring(5, html.length))); - RBS_Controls_Store[i].value = ""; - } - } - } - if (__PreviousOnPageLoad != null) - return __PreviousOnPageLoad(); - }; - - __PreviousOnPageBeforeUnload = window.onbeforeunload; - window.onbeforeunload = - function() - { - // Save the html of RenderedByScript controls, so that it can be restored for the - // browser's "Back Button" - if (typeof(RBS_Controls) != "undefined") - { - for (var i=0; i < RBS_Controls.length; i++) - RBS_Controls_Store[i].value = "HTML:" + encodeURIComponent(RBS_Controls[i].innerHTML); - } - if (__PreviousOnPageBeforeUnload != null) - return __PreviousOnPageBeforeUnload(); - }; if (bPageIsStored) { __PreviousOnPageUnload = window.onunload; window.onunload = this.OnPageUnload; } ! __bPageIsStored = bPageIsStored; } --- 70,102 ---- __doPostBack = this.DoPostBack; } ! ! // Check if callback should be forced after a browser page reload in FireFox, so all ! // controls rendered by MagicAjax-script will we redrawn on the page. ! __RBSExistField = document.getElementById("__RBSCONTROLSEXIST"); ! if (__RBSExistField != null && __RBSExistField.value == '1') { ! //alert('forcing callback for FireFox'); ! AJAXCbo.DoAjaxCall("",""); ! return; } if (bPageIsStored) { + if (typeof(RBS_Controls) != "undefined") + { + for (var i=0; i < RBS_Controls.length; i++) + RBS_Controls_Store[i].setAttribute("ExcludeFromPost", "true"); + } + + __PreviousOnPageLoad = window.onload; + window.onload = this.OnPageLoad; + + __PreviousOnPageBeforeUnload = window.onbeforeunload; + window.onbeforeunload = this.OnPageBeforeUnload; + __PreviousOnPageUnload = window.onunload; window.onunload = this.OnPageUnload; } ! __bPageIsStored = bPageIsStored; } *************** *** 157,161 **** var elemUniqueID = eventTarget.split("$").join(":"); var ids = elemUniqueID.split(":"); ! // Checks the unique id and its parents until it finds a target element // i.e. for ajaxPanel_grid:row:field it checks --- 138,142 ---- var elemUniqueID = eventTarget.split("$").join(":"); var ids = elemUniqueID.split(":"); ! // Checks the unique id and its parents until it finds a target element // i.e. for ajaxPanel_grid:row:field it checks *************** *** 173,177 **** break; } ! var cbType = AJAXCbo.GetAjaxCallType(target); if (cbType != "none") --- 154,158 ---- break; } ! var cbType = AJAXCbo.GetAjaxCallType(target); if (cbType != "none") *************** *** 186,189 **** --- 167,202 ---- } + AjaxCallObject.prototype.OnPageLoad = function() + { + // Restore the html of RenderedByScript controls + if (typeof(RBS_Controls) != "undefined") + { + for (var i=0; i < RBS_Controls.length; i++) + { + var html = RBS_Controls_Store[i].value; + if (html != "") + { + AJAXCbo.RestoreHtml(RBS_Controls[i], decodeURIComponent(html.substring(5, html.length))); + RBS_Controls_Store[i].value = ""; + } + } + } + if (__PreviousOnPageLoad != null) + return __PreviousOnPageLoad(); + } + + AjaxCallObject.prototype.OnPageBeforeUnload = function() + { + // Save the html of RenderedByScript controls, so that it can be restored for the + // browser's "Back Button" + if (typeof(RBS_Controls) != "undefined") + { + for (var i=0; i < RBS_Controls.length; i++) + RBS_Controls_Store[i].value = "HTML:" + encodeURIComponent(RBS_Controls[i].innerHTML); + } + if (__PreviousOnPageBeforeUnload != null) + return __PreviousOnPageBeforeUnload(); + } + AjaxCallObject.prototype.OnPageUnload = function() { *************** *** 192,201 **** if (index != -1) thePage = thePage.substring(0, index); ! thePage = thePage + "?__AJAX_PAGEUNLOAD=" + encodeURIComponent(document.all["__AJAX_PAGEKEY"].value); ! ! var oThis = AJAXCbo; ! __AJAXCboList.push(oThis); ! AJAXCbo = new AjaxCallObject(); if( oThis.XmlHttp ) --- 205,214 ---- if (index != -1) thePage = thePage.substring(0, index); ! thePage = thePage + "?__AJAX_PAGEUNLOAD=" + encodeURIComponent(document.all["__AJAX_PAGEKEY"].value); ! ! var oThis = AJAXCbo; ! __AJAXCboList.push(oThis); ! AJAXCbo = new AjaxCallObject(); if( oThis.XmlHttp ) *************** *** 206,210 **** oThis.XmlHttp.send(null); } ! if (__PreviousOnPageUnload != null) return __PreviousOnPageUnload(); --- 219,223 ---- oThis.XmlHttp.send(null); } ! if (__PreviousOnPageUnload != null) return __PreviousOnPageUnload(); *************** *** 217,228 **** var thePage = theform.action; var eName = ''; ! theData = '__EVENTTARGET=' + escape(eventTarget.split("$").join(":")) + '&'; theData += '__EVENTARGUMENT=' + encodeURIComponent(eventArgument) + '&'; theData += '__AJAXCALL=true&'; ! if ( ! __bPageIsStored ) theData += '__VIEWSTATE=' + escape(theform.__VIEWSTATE.value).replace(new RegExp('\\+', 'g'), '%2b') + '&'; ! for( var i=0; i<theform.elements.length; i++ ) { --- 230,241 ---- var thePage = theform.action; var eName = ''; ! theData = '__EVENTTARGET=' + escape(eventTarget.split("$").join(":")) + '&'; theData += '__EVENTARGUMENT=' + encodeURIComponent(eventArgument) + '&'; theData += '__AJAXCALL=true&'; ! if ( ! __bPageIsStored ) theData += '__VIEWSTATE=' + escape(theform.__VIEWSTATE.value).replace(new RegExp('\\+', 'g'), '%2b') + '&'; ! for( var i=0; i<theform.elements.length; i++ ) { *************** *** 241,245 **** if ( type == "submit" ) continue; ! if ( type == "textarea" ) { --- 254,258 ---- if ( type == "submit" ) continue; ! if ( type == "textarea" ) { *************** *** 248,254 **** val = val.split("\r\n").join("\n").split("\n").join("\r\n"); } ! val = encodeURIComponent(val); ! if ( type == "select-multiple" ) { --- 261,267 ---- val = val.split("\r\n").join("\n").split("\n").join("\r\n"); } ! val = encodeURIComponent(val); ! if ( type == "select-multiple" ) { *************** *** 269,273 **** if (theData.substring(theData.length-1, theData.length) == "&") theData = theData.substring(0, theData.length-1); ! if( this.XmlHttp ) { --- 282,286 ---- if (theData.substring(theData.length-1, theData.length) == "&") theData = theData.substring(0, theData.length-1); ! if( this.XmlHttp ) { *************** *** 277,281 **** MoveWaitElement(); } ! var oThis = this; __AJAXCboList.push(oThis); --- 290,294 ---- MoveWaitElement(); } ! var oThis = this; __AJAXCboList.push(oThis); *************** *** 314,333 **** } } ! AjaxCallObject.prototype.OnLoading = function() { // Loading } ! AjaxCallObject.prototype.OnLoaded = function() { // Loaded } ! AjaxCallObject.prototype.OnInteractive = function() { // Interactive } ! AjaxCallObject.prototype.OnComplete = function(responseText, responseXml) { --- 327,346 ---- } } ! AjaxCallObject.prototype.OnLoading = function() { // Loading } ! AjaxCallObject.prototype.OnLoaded = function() { // Loaded } ! AjaxCallObject.prototype.OnInteractive = function() { // Interactive } ! AjaxCallObject.prototype.OnComplete = function(responseText, responseXml) { *************** *** 343,350 **** if (waitElement) waitElement.style.visibility = 'hidden'; ! return true; } ! AjaxCallObject.prototype.OnAbort = function() { --- 356,367 ---- if (waitElement) waitElement.style.visibility = 'hidden'; ! ! // Set hidden field to indicate callback was done (used for FireFox page redraw on browser page reload) ! if (__RBSExistField != null) ! __RBSExistField.value = '1'; ! return true; } ! AjaxCallObject.prototype.OnAbort = function() { *************** *** 352,356 **** waitElement.style.visibility = 'hidden'; } ! AjaxCallObject.prototype.OnError = function(status, statusText, responseText) { --- 369,373 ---- waitElement.style.visibility = 'hidden'; } ! AjaxCallObject.prototype.OnError = function(status, statusText, responseText) { *************** *** 359,363 **** document.body.innerHTML = responseText; } ! AjaxCallObject.prototype.ReadyStateChange = function() { --- 376,380 ---- document.body.innerHTML = responseText; } ! AjaxCallObject.prototype.ReadyStateChange = function() { *************** *** 413,421 **** var store = document.createElement("form"); store.innerHTML = html; ! var scripts = store.getElementsByTagName("script"); while (scripts.length > 0) scripts[0].parentNode.removeChild(scripts[0]); ! var elements = new Array(); var coll = store.getElementsByTagName("INPUT"); --- 430,438 ---- var store = document.createElement("form"); store.innerHTML = html; ! var scripts = store.getElementsByTagName("script"); while (scripts.length > 0) scripts[0].parentNode.removeChild(scripts[0]); ! var elements = new Array(); var coll = store.getElementsByTagName("INPUT"); *************** *** 458,462 **** } } ! destElem.innerHTML = store.innerHTML; --- 475,479 ---- } } ! destElem.innerHTML = store.innerHTML; *************** *** 492,496 **** } - AjaxCallObject.prototype.SetAttributesOfControl = function(clientID, attributes) { --- 509,512 ---- *************** *** 518,522 **** place.insertBefore(child, before); } - this.SetHtmlOfElementScript (html, elementID); } --- 534,537 ---- *************** *** 582,586 **** } - var AJAXCbo = new AjaxCallObject(); --- 597,600 ---- *************** *** 622,625 **** } waitElement = elem; ! } ! // end wait element --- 636,639 ---- } waitElement = elem; ! } ! // end wait element \ No newline at end of file |