From: Dion O. <dol...@us...> - 2006-01-23 08:33:15
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26088/magicajax/Core Modified Files: MagicAjaxModule.cs Log Message: - Fixed problem with EnableEventValidation on normal postback (.NET 2.0) - Added some comments Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** MagicAjaxModule.cs 23 Jan 2006 01:28:41 -0000 1.60 --- MagicAjaxModule.cs 23 Jan 2006 08:33:05 -0000 1.61 *************** *** 459,476 **** } - _magicAjaxContext.IsAjaxCall = (_request.Form["__AJAXCALL"] != null); - - Page currentPage = HttpContext.Current.Handler as Page; - - // On Page-init, we're going to replace the regular HTMLForm control with an AjaxHMTLForm - //if (currentPage != null) - // currentPage.Init += new EventHandler(currentPage_Init); - // Continue only if it is a postback or an AjaxCall if ("GET" == _request.HttpMethod) return; #if NET_2_0 ! if (currentPage != null && _magicAjaxContext.IsAjaxCall) { // For ASP.NET 2.0, disable event validation on the page --- 459,470 ---- } // Continue only if it is a postback or an AjaxCall if ("GET" == _request.HttpMethod) return; + Page currentPage = HttpContext.Current.Handler as Page; + #if NET_2_0 ! if (currentPage != null) { // For ASP.NET 2.0, disable event validation on the page *************** *** 480,483 **** --- 474,478 ---- #endif + _magicAjaxContext.IsAjaxCall = (_request.Form["__AJAXCALL"] != null); string configState = _request.Form["__MAGICAJAX_CONFIG"]; if (configState != null) *************** *** 611,668 **** } - - // /// <summary> - // /// On Page init, we're going to we're going to replace - // /// the regular HTMLForm control with our own AjaxHMTLForm. - // /// This way we can implement a custom rendering of the form, - // /// which reflects added scripts and hidden fields on Ajax callbacks - // /// </summary> - // /// <param name="sender">The current page</param> - // /// <param name="e"></param> - // void currentPage_Init(object sender, EventArgs e) - // { - // Page thePage = (Page)sender; - // if (thePage != null) - // { - // HtmlForm oldFrm = (HtmlForm)Util.GetPrivateField(thePage, typeof(Page), "_form"); - - // //thePage.Form.SetRenderMethodDelegate - - // AjaxHtmlForm newFrm = new AjaxHtmlForm(); - - // // Copy all properties over - // Util.ForceShallowCopyOnObject(newFrm, oldFrm); - - // // when adding a control - the framework will try to disconnect it from its parent - // // so we better make sure it it has no parent. - // Util.SetPrivateField(newFrm, typeof(Control), "_parent", null); - // Util.SetPrivateField(thePage, typeof(Page), "_form", newFrm); - - // // Now replace the current Form control by our own - // Control hostingControl = (Control)thePage; - //#if NET_2_0 - // if (thePage.Master != null) - // { - // MasterPage master = thePage.Master; - // while (master.Master != null) - // master = master.Master; - - // hostingControl = (Control)master; - // } - //#else - // object readOnlyErrorMsg = Util.GetPrivateField(hostingControl.Controls, typeof(ControlCollection), "_readOnlyErrorMsg"); - // Util.SetPrivateField(hostingControl.Controls, typeof(ControlCollection), "_readOnlyErrorMsg", null); - //#endif - - // int formIndex = hostingControl.Controls.IndexOf(oldFrm); - // hostingControl.Controls.RemoveAt(formIndex); - // hostingControl.Controls.AddAt(formIndex, newFrm); - - //#if !NET_2_0 - // Util.SetPrivateField(hostingControl.Controls, typeof(ControlCollection), "_readOnlyErrorMsg", readOnlyErrorMsg); - //#endif - // } - // } - /// <summary> /// Handles the EndRequest event of the Application --- 606,609 ---- |