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: Dion O. <dol...@us...> - 2005-12-22 12:44:54
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31786/magicajax/Core Modified Files: AssemblyInfo.cs MagicAjax.csproj Log Message: - Added strongname key (Public Key token = bf4053b35db106f3) Index: MagicAjax.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MagicAjax.csproj 18 Dec 2005 16:44:46 -0000 1.7 --- MagicAjax.csproj 22 Dec 2005 12:44:43 -0000 1.8 *************** *** 105,108 **** --- 105,112 ---- /> <File + RelPath = "MagicAjax.snk" + BuildAction = "None" + /> + <File RelPath = "MagicAjaxContext.cs" SubType = "Code" Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AssemblyInfo.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AssemblyInfo.cs 9 Dec 2005 18:06:25 -0000 1.6 --- AssemblyInfo.cs 22 Dec 2005 12:44:43 -0000 1.7 *************** *** 64,67 **** --- 64,71 ---- // [assembly: AssemblyDelaySign(false)] + #if NET_2_0 [assembly: AssemblyKeyFile("")] + #else + [assembly: AssemblyKeyFile("..\\..\\MagicAjax.snk")] + #endif [assembly: AssemblyKeyName("")] |
From: Dion O. <dol...@us...> - 2005-12-22 12:19:42
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26357/magicajax/Core Modified Files: MagicAjax NET 2.0.csproj MagicAjaxModule.cs Added Files: MagicAjax.snk Log Message: - Updated MagicAjaxModule, so non-Page HttpHandlers are allowed - Added strongname key (Public Key token = bf4053b35db106f3) Index: MagicAjax NET 2.0.csproj =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjax NET 2.0.csproj,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MagicAjax NET 2.0.csproj 18 Dec 2005 16:44:46 -0000 1.10 --- MagicAjax NET 2.0.csproj 22 Dec 2005 12:19:32 -0000 1.11 *************** *** 12,17 **** </AssemblyKeyContainerName> <AssemblyName>MagicAjax</AssemblyName> ! <AssemblyOriginatorKeyFile> ! </AssemblyOriginatorKeyFile> <DefaultClientScript>JScript</DefaultClientScript> <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> --- 12,16 ---- </AssemblyKeyContainerName> <AssemblyName>MagicAjax</AssemblyName> ! <AssemblyOriginatorKeyFile>MagicAjax.snk</AssemblyOriginatorKeyFile> <DefaultClientScript>JScript</DefaultClientScript> <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> *************** *** 27,30 **** --- 26,30 ---- <UpgradeBackupLocation> </UpgradeBackupLocation> + <SignAssembly>true</SignAssembly> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> *************** *** 160,163 **** --- 160,166 ---- <Content Include="Web.config" /> </ItemGroup> + <ItemGroup> + <None Include="MagicAjax.snk" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> --- NEW FILE: MagicAjax.snk --- (This appears to be a binary file; contents omitted.) Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** MagicAjaxModule.cs 22 Dec 2005 01:26:25 -0000 1.49 --- MagicAjaxModule.cs 22 Dec 2005 12:19:32 -0000 1.50 *************** *** 433,437 **** HttpApplication application = (HttpApplication) sender; ! if (!(HttpContext.Current.Handler is Page)) { return; //if this wasn't a .aspx request, don't process --- 433,437 ---- HttpApplication application = (HttpApplication) sender; ! if (!_request.Url.AbsolutePath.EndsWith(".aspx")) { return; //if this wasn't a .aspx request, don't process *************** *** 448,462 **** } ! Page requestPage = (Page)HttpContext.Current.Handler; #if NET_2_0 - // For ASP.NET 2.0, disable event validation on the page - requestPage.EnableEventValidation = false; - //TODO: check if there is another way to avoid the event-validation exceptions in the controls - #endif ! // Continue only if it is a postback or an AjaxCall ! if ( "GET" == _request.HttpMethod ) ! return; _magicAjaxContext.IsAjaxCall = (_request.Form["__AJAXCALL"] != null); --- 448,466 ---- } ! // 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 ! currentPage.EnableEventValidation = false; ! //TODO: check if there is another way to avoid the event-validation exceptions in the controls ! } ! #endif _magicAjaxContext.IsAjaxCall = (_request.Form["__AJAXCALL"] != null); *************** *** 487,495 **** try { ! if ( viewStateIsExcluded ) { // ViewState is excluded from the post data. Disable it on // the page since its value will not be sent to client. ! (HttpContext.Current.Handler as Page).EnableViewState = false; } --- 491,499 ---- try { ! if (viewStateIsExcluded && currentPage != null) { // ViewState is excluded from the post data. Disable it on // the page since its value will not be sent to client. ! currentPage.EnableViewState = false; } *************** *** 622,630 **** #if NET_2_0 // Check if this request is to add/remove/replace a WebPart // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_request.Form["__WPPS"])) { ! string wpmValue = _filter.GetWebPartManagerScriptValue((HttpContext.Current.Handler as Page).Form.ClientID); if (wpmValue != null) { --- 626,636 ---- #if NET_2_0 + Page currentPage = HttpContext.Current.Handler as Page; + // Check if this request is to add/remove/replace a WebPart // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_request.Form["__WPPS"]) && currentPage != null) { ! string wpmValue = _filter.GetWebPartManagerScriptValue(currentPage.Form.ClientID); if (wpmValue != null) { |
From: Argiris K. <be...@us...> - 2005-12-22 01:26:40
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10239/Core Modified Files: MagicAjaxModule.cs Log Message: -Moved the ExcludedFlags property of AjaxZone to AjaxPanel. -Some renaming of methods for MagicAjaxModule Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** MagicAjaxModule.cs 22 Dec 2005 01:15:19 -0000 1.48 --- MagicAjaxModule.cs 22 Dec 2005 01:26:25 -0000 1.49 *************** *** 694,698 **** postDataChangedControls = LoadFormDataOnChildren(page); ! RaiseAjaxCallEvent (page); foreach (IPostBackDataHandler handler in postDataChangedControls) --- 694,698 ---- postDataChangedControls = LoadFormDataOnChildren(page); ! RaiseAjaxCallStartEvent (page); foreach (IPostBackDataHandler handler in postDataChangedControls) *************** *** 710,714 **** InvokeScriptWriters (page); ! RaiseAjaxCallEventEnd (page); } --- 710,714 ---- InvokeScriptWriters (page); ! RaiseAjaxCallEndEvent (page); } *************** *** 722,726 **** /// </remarks> /// <param name="control"></param> ! protected void RaiseAjaxCallEvent(Control control) { if (control is IAjaxCallEventHandler) --- 722,726 ---- /// </remarks> /// <param name="control"></param> ! protected void RaiseAjaxCallStartEvent(Control control) { if (control is IAjaxCallEventHandler) *************** *** 728,732 **** for (int i=0; i < control.Controls.Count; i++) ! RaiseAjaxCallEvent (control.Controls[i]); } --- 728,732 ---- for (int i=0; i < control.Controls.Count; i++) ! RaiseAjaxCallStartEvent (control.Controls[i]); } *************** *** 740,744 **** /// </remarks> /// <param name="control"></param> ! protected void RaiseAjaxCallEventEnd(Control control) { if (control is IAjaxCallEventHandler) --- 740,744 ---- /// </remarks> /// <param name="control"></param> ! protected void RaiseAjaxCallEndEvent(Control control) { if (control is IAjaxCallEventHandler) *************** *** 746,750 **** for (int i=0; i < control.Controls.Count; i++) ! RaiseAjaxCallEventEnd (control.Controls[i]); } --- 746,750 ---- for (int i=0; i < control.Controls.Count; i++) ! RaiseAjaxCallEndEvent (control.Controls[i]); } |
From: Argiris K. <be...@us...> - 2005-12-22 01:26:39
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10239/Core/UI/Controls Modified Files: AjaxPanel.cs AjaxZone.cs Log Message: -Moved the ExcludedFlags property of AjaxZone to AjaxPanel. -Some renaming of methods for MagicAjaxModule Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** AjaxPanel.cs 22 Dec 2005 01:15:20 -0000 1.43 --- AjaxPanel.cs 22 Dec 2005 01:26:25 -0000 1.44 *************** *** 53,56 **** --- 53,88 ---- } + public enum ExcludeFromPostFlag + { + /// <summary> + /// Post all elements + /// </summary> + None = 0, + /// <summary> + /// Do not post ViewState + /// </summary> + ViewState = 1, + /// <summary> + /// Do not post the control fingerprints hidden fields + /// </summary> + Fingerprints = 2, + /// <summary> + /// Do not post the custom hidden fields of the user + /// </summary> + UserHidden = 4, + /// <summary> + /// Do not post any hidden field + /// </summary> + AllHidden = 7, + /// <summary> + /// Do not post any (non-hidden) form element + /// </summary> + FormElements = 8, + /// <summary> + /// Do not post any element + /// </summary> + AllElements = 15 + } + /// <summary> /// Works like Panel but the controls it contains are rendered on the page by sending *************** *** 83,86 **** --- 115,119 ---- private AjaxCallConnectionType _ajaxCallConnection = AjaxCallConnectionType.Asynchronous; + private ExcludeFromPostFlag _excludeFlags = ExcludeFromPostFlag.None; private ArrayList _addedControls = new ArrayList(); private ArrayList _removedControls = new ArrayList(); *************** *** 111,114 **** --- 144,150 ---- /// Default is AjaxCallConnectionType.Asynchronous. /// </summary> + [Bindable(false), + Category("Behaviour"), + DefaultValue(AjaxCallConnectionType.Asynchronous)] public AjaxCallConnectionType AjaxCallConnection { *************** *** 118,121 **** --- 154,172 ---- #endregion + #region ExcludeFlags + /// <summary> + /// Defines the form elements that will be excluded from the POST data. + /// Default is ExcludeFromPostFlag.None. + /// </summary> + [Bindable(false), + Category("Behaviour"), + DefaultValue(ExcludeFromPostFlag.None)] + public ExcludeFromPostFlag ExcludeFlags + { + get { return _excludeFlags; } + set { _excludeFlags = value; } + } + #endregion + #endregion *************** *** 323,326 **** --- 374,386 ---- break; } + + if (_excludeFlags == ExcludeFromPostFlag.None) + { + this.Attributes.Remove ("ExcludeFlags"); + } + else + { + this.Attributes["ExcludeFlags"] = ((int)_excludeFlags).ToString(); + } } Index: AjaxZone.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxZone.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AjaxZone.cs 22 Dec 2005 01:15:20 -0000 1.2 --- AjaxZone.cs 22 Dec 2005 01:26:25 -0000 1.3 *************** *** 5,40 **** namespace MagicAjax.UI.Controls { - public enum ExcludeFromPostFlag - { - /// <summary> - /// Post all elements - /// </summary> - None = 0, - /// <summary> - /// Do not post ViewState - /// </summary> - ViewState = 1, - /// <summary> - /// Do not post the control fingerprints hidden fields - /// </summary> - Fingerprints = 2, - /// <summary> - /// Do not post the custom hidden fields of the user - /// </summary> - UserHidden = 4, - /// <summary> - /// Do not post any hidden field - /// </summary> - AllHidden = 7, - /// <summary> - /// Do not post any (non-hidden) form element - /// </summary> - FormElements = 8, - /// <summary> - /// Do not post any element - /// </summary> - AllElements = 15 - } - /// <summary> /// Summary description for AjaxZone. --- 5,8 ---- *************** *** 42,70 **** public class AjaxZone : AjaxPanel { - private ExcludeFromPostFlag _excludeFlags = ExcludeFromPostFlag.None; - - [Bindable(false), - Category("Behaviour"), - DefaultValue(ExcludeFromPostFlag.None)] - public ExcludeFromPostFlag ExcludeFlags - { - get { return _excludeFlags; } - set { _excludeFlags = value; } - } - - protected override void SetAjaxAttributes() - { - base.SetAjaxAttributes (); - - if (_excludeFlags == ExcludeFromPostFlag.None) - { - this.Attributes.Remove ("ExcludeFlags"); - } - else - { - this.Attributes["ExcludeFlags"] = ((int)_excludeFlags).ToString(); - } - } - protected override void OnLoad(EventArgs e) { --- 10,13 ---- |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:31
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Core/UI Modified Files: AjaxControl.cs AjaxPage.cs AjaxUserControl.cs RenderedByScriptControl.cs Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: AjaxUserControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxUserControl.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AjaxUserControl.cs 30 Nov 2005 12:22:29 -0000 1.9 --- AjaxUserControl.cs 22 Dec 2005 01:15:20 -0000 1.10 *************** *** 33,70 **** /// IAjaxCallEventHandler on your usercontrol to handle the AjaxCall events. /// </remarks> ! public class AjaxUserControl : System.Web.UI.UserControl, IAjaxCallEventHandler { private MagicAjaxContext _magicAjaxContext; /// <summary> ! /// Raised by MagicAjaxModule when an AjaxCall occurs /// </summary> ! public event EventHandler AjaxCall; /// <summary> ! /// Raised by MagicAjaxModule when an AjaxCallEnd occurs /// </summary> public event EventHandler AjaxCallEnd; /// <summary> ! /// Raises the AjaxCall event. /// </summary> ! /// <remarks> ! /// Called by MagicAjaxModule. ! /// </remarks> ! public void RaiseAjaxCallEvent() { ! OnAjaxCall (EventArgs.Empty); } /// <summary> ! /// Raises the AjaxCallEnd event. /// </summary> - /// <remarks> - /// Called by MagicAjaxModule. - /// </remarks> public void RaiseAjaxCallEndEvent() { ! OnAjaxCallEnd (EventArgs.Empty); } --- 33,86 ---- /// IAjaxCallEventHandler on your usercontrol to handle the AjaxCall events. /// </remarks> ! public class AjaxUserControl : System.Web.UI.UserControl, IAjaxCallEventHandler, IPreWriteScriptEventHandler { private MagicAjaxContext _magicAjaxContext; + private bool _isAjaxCall; + private bool _isPageNoStoreMode; /// <summary> ! /// Raised by the MagicAjaxModule and at Load event during an AjaxCall. /// </summary> ! public event EventHandler AjaxCallStart; /// <summary> ! /// Raised by the MagicAjaxModule and at PreRender event during an AjaxCall. ! /// </summary> ! public event EventHandler PreWriteScript; ! ! /// <summary> ! /// Raised by the MagicAjaxModule and at Unload event during an AjaxCall. /// </summary> public event EventHandler AjaxCallEnd; /// <summary> ! /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> ! public void RaiseAjaxCallStartEvent() { ! SetAjaxIntrinsics(); ! OnAjaxCallStart(EventArgs.Empty); } /// <summary> ! /// Implements the IPreWriteScriptEventHandler interface. It is called by the MagicAjaxModule. ! /// </summary> ! public void RaisePreWriteScriptEvent() ! { ! OnPreWriteScript (EventArgs.Empty); ! } ! ! /// <summary> ! /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> public void RaiseAjaxCallEndEvent() { ! OnAjaxCallEnd(EventArgs.Empty); ! } ! ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsPageNoStoreMode ! { ! get { return _isPageNoStoreMode; } } *************** *** 75,79 **** public bool IsAjaxCall { ! get { return HttpContext.Current != null && MagicAjaxContext.Current.IsAjaxCallForPage(this.Page); } } --- 91,95 ---- public bool IsAjaxCall { ! get { return _isAjaxCall; } } *************** *** 83,103 **** } ! protected override void OnInit(EventArgs e) { ! _magicAjaxContext = MagicAjaxContext.Current; ! base.OnInit (e); } ! protected virtual void OnAjaxCall(EventArgs e) { ! if (AjaxCall != null) ! AjaxCall(this, e); } protected virtual void OnAjaxCallEnd(EventArgs e) { if (AjaxCallEnd != null) AjaxCallEnd(this, e); } } } \ No newline at end of file --- 99,151 ---- } ! protected override void OnLoad(EventArgs e) { ! SetAjaxIntrinsics(); ! ! base.OnLoad (e); ! if ( IsAjaxCall ) ! OnAjaxCallStart (e); } ! protected override void OnPreRender(EventArgs e) { ! base.OnPreRender (e); ! if ( IsAjaxCall ) ! OnPreWriteScript (e); ! } ! ! protected override void OnUnload(EventArgs e) ! { ! base.OnUnload (e); ! if ( IsAjaxCall ) ! OnAjaxCallEnd (e); ! } ! ! protected virtual void OnAjaxCallStart(EventArgs e) ! { ! if (AjaxCallStart != null) ! AjaxCallStart(this, e); ! } ! ! protected virtual void OnPreWriteScript(EventArgs e) ! { ! if (PreWriteScript != null) ! PreWriteScript(this, e); } protected virtual void OnAjaxCallEnd(EventArgs e) { + _magicAjaxContext = null; + if (AjaxCallEnd != null) AjaxCallEnd(this, e); } + + protected virtual void SetAjaxIntrinsics() + { + _magicAjaxContext = MagicAjaxContext.Current; + _isAjaxCall = ( HttpContext.Current != null && this.Page != null && MagicAjaxContext.Current.IsAjaxCallForPage(this.Page) ); + _isPageNoStoreMode = ( HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode ); + } } } \ No newline at end of file Index: AjaxPage.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxPage.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AjaxPage.cs 30 Nov 2005 12:22:29 -0000 1.8 --- AjaxPage.cs 22 Dec 2005 01:15:20 -0000 1.9 *************** *** 33,79 **** /// implement the IAjaxCallEventHandler on your page to handle the AjaxCall events. /// </remarks> ! public class AjaxPage : System.Web.UI.Page, IAjaxCallEventHandler { private MagicAjaxContext _magicAjaxContext; /// <summary> ! /// Raised by MagicAjaxModule when an AjaxCall occurs /// </summary> ! public event EventHandler AjaxCall; /// <summary> ! /// Raised by MagicAjaxModule when an AjaxCallEnd occurs /// </summary> public event EventHandler AjaxCallEnd; /// <summary> ! /// Raises the AjaxCall event. /// </summary> ! /// <remarks> ! /// Called by MagicAjaxModule. ! /// </remarks> ! public void RaiseAjaxCallEvent() { ! OnAjaxCall (EventArgs.Empty); } /// <summary> ! /// Raises the AjaxCallEnd event. /// </summary> - /// <remarks> - /// Called by MagicAjaxModule. - /// </remarks> public void RaiseAjaxCallEndEvent() { ! OnAjaxCallEnd (EventArgs.Empty); } /// <summary> ! /// Determines if the page is being processed during an AjaxCall. /// </summary> [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsAjaxCall { ! get { return HttpContext.Current != null && MagicAjaxContext.Current.IsAjaxCallForPage(this); } } --- 33,95 ---- /// implement the IAjaxCallEventHandler on your page to handle the AjaxCall events. /// </remarks> ! public class AjaxPage : System.Web.UI.Page, IAjaxCallEventHandler, IPreWriteScriptEventHandler { private MagicAjaxContext _magicAjaxContext; + private bool _isAjaxCall; + private bool _isPageNoStoreMode; /// <summary> ! /// Raised by the MagicAjaxModule and at Load event during an AjaxCall. /// </summary> ! public event EventHandler AjaxCallStart; /// <summary> ! /// Raised by the MagicAjaxModule and at PreRender event during an AjaxCall. ! /// </summary> ! public event EventHandler PreWriteScript; ! ! /// <summary> ! /// Raised by the MagicAjaxModule and at Unload event during an AjaxCall. /// </summary> public event EventHandler AjaxCallEnd; /// <summary> ! /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> ! public void RaiseAjaxCallStartEvent() { ! SetAjaxIntrinsics(); ! OnAjaxCallStart(EventArgs.Empty); } /// <summary> ! /// Implements the IPreWriteScriptEventHandler interface. It is called by the MagicAjaxModule. ! /// </summary> ! public void RaisePreWriteScriptEvent() ! { ! OnPreWriteScript (EventArgs.Empty); ! } ! ! /// <summary> ! /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> public void RaiseAjaxCallEndEvent() { ! OnAjaxCallEnd(EventArgs.Empty); ! } ! ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsPageNoStoreMode ! { ! get { return _isPageNoStoreMode; } } /// <summary> ! /// Determines if the control is being processed during an AjaxCall. /// </summary> [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsAjaxCall { ! get { return _isAjaxCall; } } *************** *** 83,103 **** } ! protected override void OnInit(EventArgs e) { ! _magicAjaxContext = MagicAjaxContext.Current; ! base.OnInit (e); } ! protected virtual void OnAjaxCall(EventArgs e) { ! if (AjaxCall != null) ! AjaxCall(this, e); } protected virtual void OnAjaxCallEnd(EventArgs e) { if (AjaxCallEnd != null) AjaxCallEnd(this, e); } } } \ No newline at end of file --- 99,151 ---- } ! protected override void OnLoad(EventArgs e) { ! SetAjaxIntrinsics(); ! ! base.OnLoad (e); ! if ( IsAjaxCall ) ! OnAjaxCallStart (e); } ! protected override void OnPreRender(EventArgs e) { ! base.OnPreRender (e); ! if ( IsAjaxCall ) ! OnPreWriteScript (e); ! } ! ! protected override void OnUnload(EventArgs e) ! { ! base.OnUnload (e); ! if ( IsAjaxCall ) ! OnAjaxCallEnd (e); ! } ! ! protected virtual void OnAjaxCallStart(EventArgs e) ! { ! if (AjaxCallStart != null) ! AjaxCallStart(this, e); ! } ! ! protected virtual void OnPreWriteScript(EventArgs e) ! { ! if (PreWriteScript != null) ! PreWriteScript(this, e); } protected virtual void OnAjaxCallEnd(EventArgs e) { + _magicAjaxContext = null; + if (AjaxCallEnd != null) AjaxCallEnd(this, e); } + + protected virtual void SetAjaxIntrinsics() + { + _magicAjaxContext = MagicAjaxContext.Current; + _isAjaxCall = ( HttpContext.Current != null && this.Page != null && MagicAjaxContext.Current.IsAjaxCallForPage(this) ); + _isPageNoStoreMode = ( HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode ); + } } } \ No newline at end of file Index: AjaxControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxControl.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AjaxControl.cs 18 Dec 2005 16:44:46 -0000 1.10 --- AjaxControl.cs 22 Dec 2005 01:15:20 -0000 1.11 *************** *** 31,48 **** /// The base control for controls to get notified for AjaxCall events from the client. /// </summary> ! public abstract class AjaxControl : System.Web.UI.WebControls.WebControl, IAjaxCallEventHandler { private MagicAjaxContext _magicAjaxContext; private bool _isAjaxCall; private bool _isPageNoStoreMode; ! private bool _isInAjaxZone; /// <summary> ! /// Raised by the MagicAjaxModule. /// </summary> ! public event EventHandler AjaxCall; /// <summary> ! /// Raised by the MagicAjaxModule. /// </summary> public event EventHandler AjaxCallEnd; --- 31,53 ---- /// The base control for controls to get notified for AjaxCall events from the client. /// </summary> ! public abstract class AjaxControl : System.Web.UI.WebControls.WebControl, IAjaxCallEventHandler, IPreWriteScriptEventHandler { private MagicAjaxContext _magicAjaxContext; private bool _isAjaxCall; private bool _isPageNoStoreMode; ! private bool _isInAjaxScope; /// <summary> ! /// Raised by the MagicAjaxModule and at Load event during an AjaxCall. /// </summary> ! public event EventHandler AjaxCallStart; /// <summary> ! /// Raised by the MagicAjaxModule and at PreRender event during an AjaxCall. ! /// </summary> ! public event EventHandler PreWriteScript; ! ! /// <summary> ! /// Raised by the MagicAjaxModule and at Unload event during an AjaxCall. /// </summary> public event EventHandler AjaxCallEnd; *************** *** 51,57 **** /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> ! public void RaiseAjaxCallEvent() { ! OnAjaxCall(EventArgs.Empty); } --- 56,72 ---- /// Implements the IAjaxCallEventHandler interface. It is called by the MagicAjaxModule. /// </summary> ! public void RaiseAjaxCallStartEvent() { ! SetAjaxIntrinsics(); ! OnAjaxCallStart(EventArgs.Empty); ! } ! ! /// <summary> ! /// Implements the IPreWriteScriptEventHandler interface. It is called by the MagicAjaxModule. ! /// </summary> ! public void RaisePreWriteScriptEvent() ! { ! SetAjaxAttributes(); ! OnPreWriteScript (EventArgs.Empty); } *************** *** 80,86 **** [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsInAjaxZone { ! get { return _isInAjaxZone; } } --- 95,101 ---- [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsInAjaxScope { ! get { return _isInAjaxScope; } } *************** *** 99,104 **** protected override void OnLoad(EventArgs e) { base.OnLoad (e); ! InitAjaxIntrinsics(); } --- 114,122 ---- protected override void OnLoad(EventArgs e) { + SetAjaxIntrinsics(); + base.OnLoad (e); ! if ( IsAjaxCall ) ! OnAjaxCallStart (e); } *************** *** 107,110 **** --- 125,129 ---- // Register 'AjaxCallObject.js' script MagicAjaxModule.EnableAjaxOnPage(this.Page); + SetAjaxAttributes(); #if NET_2_0 *************** *** 114,125 **** base.OnPreRender (e); } ! protected virtual void OnAjaxCall(EventArgs e) { ! InitAjaxIntrinsics(); ! if (AjaxCall != null) ! AjaxCall(this, e); } --- 133,157 ---- base.OnPreRender (e); + if ( IsAjaxCall ) + OnPreWriteScript (e); } ! protected override void OnUnload(EventArgs e) { ! base.OnUnload (e); ! if ( IsAjaxCall ) ! OnAjaxCallEnd (e); ! } ! protected virtual void OnAjaxCallStart(EventArgs e) ! { ! if (AjaxCallStart != null) ! AjaxCallStart(this, e); ! } ! ! protected virtual void OnPreWriteScript(EventArgs e) ! { ! if (PreWriteScript != null) ! PreWriteScript(this, e); } *************** *** 132,136 **** } ! protected virtual void InitAjaxIntrinsics() { _magicAjaxContext = MagicAjaxContext.Current; --- 164,168 ---- } ! protected virtual void SetAjaxIntrinsics() { _magicAjaxContext = MagicAjaxContext.Current; *************** *** 138,148 **** _isPageNoStoreMode = ( HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode ); ! string ajaxZoneID = Context.Request.Form["__AJAXZONE"]; ! _isInAjaxZone = ( ajaxZoneID == null || IsInAjaxZoneRecursive(this, ajaxZoneID) ); } ! private bool IsInAjaxZoneRecursive (Control control, string ajaxZoneID) { ! if (control.ClientID == ajaxZoneID) return true; --- 170,189 ---- _isPageNoStoreMode = ( HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode ); ! string ajaxScopeID = Context.Request.Form["__AJAXSCOPE"]; ! _isInAjaxScope = ( ajaxScopeID == null || IsInAjaxScopeRecursive(this, ajaxScopeID) ); } ! /// <summary> ! /// It is empty for the AjaxControl class. It is meant to be overriden ! /// by subclasses so that they set their MagicAjax attributes in their Attributes ! /// collection. ! /// </summary> ! protected virtual void SetAjaxAttributes() { ! } ! ! private bool IsInAjaxScopeRecursive (Control control, string ajaxScopeID) ! { ! if (control.ClientID == ajaxScopeID) return true; *************** *** 150,154 **** return false; ! return IsInAjaxZoneRecursive(control.Parent, ajaxZoneID); } } --- 191,195 ---- return false; ! return IsInAjaxScopeRecursive(control.Parent, ajaxScopeID); } } Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RenderedByScriptControl.cs 18 Dec 2005 16:44:46 -0000 1.15 --- RenderedByScriptControl.cs 22 Dec 2005 01:15:20 -0000 1.16 *************** *** 69,73 **** /// its tag attributes using javascript. /// </remarks> ! public abstract class RenderedByScriptControl : AjaxControl, IPreWriteScriptEventHandler, IScriptWriter { protected abstract void RenderByScript(); --- 69,73 ---- /// its tag attributes using javascript. /// </remarks> ! public abstract class RenderedByScriptControl : AjaxControl, IScriptWriter { protected abstract void RenderByScript(); *************** *** 81,85 **** public event RenderStartEventHandler RenderStart; public event EventHandler RenderEnd; - public event EventHandler PreWriteScript; public override bool Visible --- 81,84 ---- *************** *** 223,230 **** } ! protected override void OnAjaxCall(EventArgs e) { _isHtmlRendered = false; ! base.OnAjaxCall(e); } --- 222,229 ---- } ! protected override void OnAjaxCallStart(EventArgs e) { _isHtmlRendered = false; ! base.OnAjaxCallStart(e); } *************** *** 286,302 **** /// <summary> - /// Called by MagicAjaxModule - /// </summary> - public virtual void RaisePreWriteScriptEvent() - { - OnPreWriteScript (EventArgs.Empty); - } - - /// <summary> /// If the tag html of the control is changed, send the attributes using javascript. /// </summary> public virtual void WriteScript() { ! if ( ! this.IsInAjaxZone ) return; --- 285,293 ---- /// <summary> /// If the tag html of the control is changed, send the attributes using javascript. /// </summary> public virtual void WriteScript() { ! if ( ! this.IsInAjaxScope ) return; *************** *** 388,397 **** RenderEnd(this, e); } - - protected virtual void OnPreWriteScript(EventArgs e) - { - if (PreWriteScript != null) - PreWriteScript(this, e); - } /// <summary> --- 379,382 ---- |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:31
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Core/UI/Controls Modified Files: AjaxPanel.cs AjaxZone.cs Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** AjaxPanel.cs 21 Dec 2005 00:40:23 -0000 1.42 --- AjaxPanel.cs 22 Dec 2005 01:15:20 -0000 1.43 *************** *** 164,173 **** base.OnLoad (e); - if (this.Attributes["AjaxCall"] == null) - { - // To set the appropriate "AjaxCall" attribute. - this.AjaxCallConnection = this._ajaxCallConnection; - } - if ( this.MagicAjaxContext.IsBrowserSupported ) { --- 164,167 ---- *************** *** 185,208 **** #endregion ! #region override OnPreRender ! protected override void OnPreRender(EventArgs e) ! { ! base.OnPreRender (e); ! SetAjaxAttributes(); ! } ! #endregion ! ! #region override OnPreWriteScript ! protected override void OnPreWriteScript(EventArgs e) ! { ! base.OnPreWriteScript (e); ! SetAjaxAttributes(); ! } ! #endregion ! ! #region override OnUnload ! protected override void OnUnload(EventArgs e) { ! if ( IsAjaxCall && IsPageNoStoreMode && IsRenderedOnPage) { // Verify that it is indeed rendered on page. If it's not, set its --- 179,186 ---- #endregion ! #region override OnAjaxCallEnd ! protected override void OnAjaxCallEnd(EventArgs e) { ! if ( IsPageNoStoreMode && IsRenderedOnPage) { // Verify that it is indeed rendered on page. If it's not, set its *************** *** 212,216 **** } ! base.OnUnload (e); } #endregion --- 190,194 ---- } ! base.OnAjaxCallEnd (e); } #endregion *************** *** 329,333 **** #endregion ! protected virtual void SetAjaxAttributes() { switch (_ajaxCallConnection) --- 307,311 ---- #endregion ! protected override void SetAjaxAttributes() { switch (_ajaxCallConnection) Index: AjaxZone.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxZone.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AjaxZone.cs 18 Dec 2005 16:44:46 -0000 1.1 --- AjaxZone.cs 22 Dec 2005 01:15:20 -0000 1.2 *************** *** 44,48 **** private ExcludeFromPostFlag _excludeFlags = ExcludeFromPostFlag.None; ! [Bindable(false), Category("Behaviour"), DefaultValue(ExcludeFromPostFlag.None)] --- 44,48 ---- private ExcludeFromPostFlag _excludeFlags = ExcludeFromPostFlag.None; ! [Bindable(false), Category("Behaviour"), DefaultValue(ExcludeFromPostFlag.None)] *************** *** 70,74 **** { base.OnLoad (e); ! this.Attributes["AjaxType"] = "ajaxzone"; } } --- 70,74 ---- { base.OnLoad (e); ! this.Attributes["AjaxLocalScope"] = "true"; } } |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:31
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Core/script Modified Files: AjaxCallObject.js Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AjaxCallObject.js 20 Dec 2005 13:11:08 -0000 1.34 --- AjaxCallObject.js 22 Dec 2005 01:15:20 -0000 1.35 *************** *** 72,82 **** } ! AjaxCallObject.prototype.GetAjaxZoneID = function(element) { if (element == null) return null; ! var attrib = element.getAttribute("AjaxType"); ! if ( attrib != null && attrib.toLowerCase() == "ajaxzone" ) return element.getAttribute("id") --- 72,82 ---- } ! AjaxCallObject.prototype.GetAjaxScopeID = function(element) { if (element == null) return null; ! var attrib = element.getAttribute("AjaxLocalScope"); ! if ( attrib != null && attrib.toLowerCase() == "true" ) return element.getAttribute("id") *************** *** 84,88 **** return null; else ! return this.GetAjaxZoneID(element.parentNode); } --- 84,88 ---- return null; else ! return this.GetAjaxScopeID(element.parentNode); } *************** *** 117,121 **** { fprintElem = document.getElementById(name.substr(fprintConst.length)); ! if ( ! this.IsInAjaxZone(fprintElem, zoneID) ) return true; } --- 117,121 ---- { fprintElem = document.getElementById(name.substr(fprintConst.length)); ! if ( ! this.IsInAjaxScope(fprintElem, zoneID) ) return true; } *************** *** 131,135 **** return true; ! return ( zoneID != null && !this.IsInAjaxZone(element, zoneID) ) } --- 131,135 ---- return true; ! return ( zoneID != null && !this.IsInAjaxScope(element, zoneID) ) } *************** *** 153,160 **** } ! AjaxCallObject.prototype.IsInAjaxZone = function(element, zoneID) { ! var attrib = element.getAttribute("AjaxType"); ! if ( attrib != null && attrib.toLowerCase() == "ajaxzone" && element.getAttribute("id") == zoneID ) return true; --- 153,160 ---- } ! AjaxCallObject.prototype.IsInAjaxScope = function(element, zoneID) { ! var attrib = element.getAttribute("AjaxLocalScope"); ! if ( attrib != null && attrib.toLowerCase() == "true" && element.getAttribute("id") == zoneID ) return true; *************** *** 162,166 **** return false; else ! return this.IsInAjaxZone(element.parentNode, zoneID); } --- 162,166 ---- return false; else ! return this.IsInAjaxScope(element.parentNode, zoneID); } *************** *** 252,256 **** if (cbType != "none") { ! AJAXCbo.DoAjaxCall(target.name, "", cbType, AJAXCbo.GetAjaxZoneID(target)); return false; } --- 252,256 ---- if (cbType != "none") { ! AJAXCbo.DoAjaxCall(target.name, "", cbType, AJAXCbo.GetAjaxScopeID(target)); return false; } *************** *** 276,280 **** if (cbType != "none") { ! AJAXCbo.DoAjaxCall(eventTarget, eventArgument, cbType, AJAXCbo.GetAjaxZoneID(target)); } else --- 276,280 ---- if (cbType != "none") { ! AJAXCbo.DoAjaxCall(eventTarget, eventArgument, cbType, AJAXCbo.GetAjaxScopeID(target)); } else *************** *** 352,356 **** } ! AjaxCallObject.prototype.DoAjaxCall = function(eventTarget, eventArgument, ajaxCallType, ajaxZoneID) { //defaults --- 352,356 ---- } ! AjaxCallObject.prototype.DoAjaxCall = function(eventTarget, eventArgument, ajaxCallType, ajaxScopeID) { //defaults *************** *** 366,371 **** theData += '__AJAXCALL=true&'; ! if (ajaxZoneID != null) ! theData += '__AJAXZONE=' + ajaxZoneID + '&'; var excludeFlags = this.GetExcludeFlags( this.GetTargetElement(eventTarget) ); --- 366,371 ---- theData += '__AJAXCALL=true&'; ! if (ajaxScopeID != null) ! theData += '__AJAXSCOPE=' + ajaxScopeID + '&'; var excludeFlags = this.GetExcludeFlags( this.GetTargetElement(eventTarget) ); *************** *** 382,386 **** // Do Nothing } ! else if ( ! this.ExcludeFromPost(curElem, ajaxZoneID, excludeFlags) ) { if ( __bPageIsStored && eName == '__VIEWSTATE' ) --- 382,386 ---- // Do Nothing } ! else if ( ! this.ExcludeFromPost(curElem, ajaxScopeID, excludeFlags) ) { if ( __bPageIsStored && eName == '__VIEWSTATE' ) |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:31
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Core Modified Files: MagicAjaxModule.cs Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** MagicAjaxModule.cs 21 Dec 2005 12:21:44 -0000 1.47 --- MagicAjaxModule.cs 22 Dec 2005 01:15:19 -0000 1.48 *************** *** 725,729 **** { if (control is IAjaxCallEventHandler) ! ((IAjaxCallEventHandler) control).RaiseAjaxCallEvent(); for (int i=0; i < control.Controls.Count; i++) --- 725,729 ---- { if (control is IAjaxCallEventHandler) ! ((IAjaxCallEventHandler) control).RaiseAjaxCallStartEvent(); for (int i=0; i < control.Controls.Count; i++) |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:30
|
Update of /cvsroot/magicajax/magicajax/Core/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Core/Interfaces Modified Files: IAjaxCallEventHandler.cs IPreWriteScriptEventHandler.cs IScriptWriter.cs Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: IAjaxCallEventHandler.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Interfaces/IAjaxCallEventHandler.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IAjaxCallEventHandler.cs 20 Nov 2005 08:47:29 -0000 1.3 --- IAjaxCallEventHandler.cs 22 Dec 2005 01:15:19 -0000 1.4 *************** *** 22,26 **** using System; ! namespace MagicAjax { /// <summary> --- 22,26 ---- using System; ! namespace MagicAjax.UI { /// <summary> *************** *** 36,42 **** /// public class CustomTextBox : System.Web.UI.WebControls.TextBox, IAjaxCallEventHandler /// { ! /// public void RaiseAjaxCallEvent() /// { ! /// OnAjaxCall(EventArgs.Empty); /// } /// public void RaiseAjaxCallEndEvent() --- 36,42 ---- /// public class CustomTextBox : System.Web.UI.WebControls.TextBox, IAjaxCallEventHandler /// { ! /// public void RaiseAjaxCallStartEvent() /// { ! /// OnAjaxCallStart(EventArgs.Empty); /// } /// public void RaiseAjaxCallEndEvent() *************** *** 48,52 **** public interface IAjaxCallEventHandler { ! void RaiseAjaxCallEvent(); void RaiseAjaxCallEndEvent(); } --- 48,52 ---- public interface IAjaxCallEventHandler { ! void RaiseAjaxCallStartEvent(); void RaiseAjaxCallEndEvent(); } Index: IPreWriteScriptEventHandler.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Interfaces/IPreWriteScriptEventHandler.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IPreWriteScriptEventHandler.cs 20 Nov 2005 08:47:29 -0000 1.3 --- IPreWriteScriptEventHandler.cs 22 Dec 2005 01:15:19 -0000 1.4 *************** *** 22,26 **** using System; ! namespace MagicAjax { /// <summary> --- 22,26 ---- using System; ! namespace MagicAjax.UI { /// <summary> Index: IScriptWriter.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Interfaces/IScriptWriter.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IScriptWriter.cs 20 Nov 2005 08:47:29 -0000 1.4 --- IScriptWriter.cs 22 Dec 2005 01:15:19 -0000 1.5 *************** *** 22,26 **** using System; ! namespace MagicAjax { /// <summary> --- 22,26 ---- using System; ! namespace MagicAjax.UI { /// <summary> |
From: Argiris K. <be...@us...> - 2005-12-22 01:15:28
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7486/Docs Modified Files: Changelog.html Log Message: A bit of refactoring for the ajax events handling. --AjaxCall event is renamed to AjaxCallStart --AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax callback --Some minor modifications to make extending AjaxControl a bit easier. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Changelog.html 21 Dec 2005 00:40:23 -0000 1.17 --- Changelog.html 22 Dec 2005 01:15:20 -0000 1.18 *************** *** 58,65 **** <ul> <li> ! Improved performance <LI> ! There were conflicts with other HttpModules when they modified cookies; fixed ! it <LI> Optimizations for the javascript client --- 58,71 ---- <ul> <li> ! AjaxCall event is renamed to AjaxCallStart <LI> ! AjaxControl/AjaxPage/AjaxUserControl invoke AjaxCallStart at Load event, ! PreWriteScript at PreRender, and AjaxCallEnd at Unload, during an Ajax ! callback ! <LI> ! Huge performance improvement ! <LI> ! There were conflicts with the cookies handling by ASP.NET 2.0 and other ! HttpModules; fixed it <LI> Optimizations for the javascript client |
From: Argiris K. <be...@us...> - 2005-12-21 12:21:52
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12442/Core Modified Files: MagicAjaxModule.cs Log Message: Fixed a compilation error for NET 2.0. Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** MagicAjaxModule.cs 21 Dec 2005 00:40:23 -0000 1.46 --- MagicAjaxModule.cs 21 Dec 2005 12:21:44 -0000 1.47 *************** *** 626,630 **** if (!string.IsNullOrEmpty(_request.Form["__WPPS"])) { ! string wpmValue = _filter.GetWebPartManagerScriptValue(requestPage.Form.ClientID); if (wpmValue != null) { --- 626,630 ---- if (!string.IsNullOrEmpty(_request.Form["__WPPS"])) { ! string wpmValue = _filter.GetWebPartManagerScriptValue((HttpContext.Current.Handler as Page).Form.ClientID); if (wpmValue != null) { |
From: Argiris K. <be...@us...> - 2005-12-21 00:40:31
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21640/Core Modified Files: MagicAjaxModule.cs Util.cs Log Message: Moved all RegExs to Util.cs as static objects. Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Util.cs 20 Dec 2005 22:48:12 -0000 1.17 --- Util.cs 21 Dec 2005 00:40:23 -0000 1.18 *************** *** 38,41 **** --- 38,49 ---- public const string FormElementPattern = @"<(?<tag>input|textarea|select)\s+(?<attribute>(?<attrname>[-\w]+)=((""|')(?<attrvalue>.*?)(""|')\s*|(?<attrvalue>[-\w]+)\s*))*.*?(/>|>(?<inner>.*?)</\k'tag'>)"; + #region Global Regular Expressions + private static RegexOptions _options = RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture; + public static Regex FormElementRegEx = new Regex(Util.FormElementPattern, _options); + public static Regex FormElementOptionsRegEx = new Regex("<option\\s((?<attrname>[-\\w]+)=\"(?<attrvalue>.*?)\"\\s?)*\\s*>.*?</option>", _options); + public static Regex FormElementOptionSelectedRegEx = new Regex(@"<option.*?(?<selected>selected=(""|'|)selected(""|'|)(\s+|(?=>))).*?>", _options); + public static Regex ScriptPatternRegEx = new Regex(Util.ScriptPattern, RegexOptions.IgnoreCase); + #endregion + /// <summary> /// Add 'defer' attribute to script tags excluding external script files. *************** *** 53,57 **** StringBuilder sb = new StringBuilder(html); ! Regex regEx = MagicAjaxModule.ScriptPattern; MatchCollection scriptMatches = regEx.Matches(html); //MatchCollection scriptMatches = Regex.Matches(html, ScriptPattern, RegexOptions.IgnoreCase); --- 61,65 ---- StringBuilder sb = new StringBuilder(html); ! Regex regEx = Util.ScriptPatternRegEx; MatchCollection scriptMatches = regEx.Matches(html); //MatchCollection scriptMatches = Regex.Matches(html, ScriptPattern, RegexOptions.IgnoreCase); *************** *** 115,119 **** { StringBuilder strbuild = new StringBuilder(html); ! Regex regEx = MagicAjaxModule.FormElementOptionsRegEx; MatchCollection matches = regEx.Matches(html); int diff = 0; --- 123,127 ---- { StringBuilder strbuild = new StringBuilder(html); ! Regex regEx = Util.FormElementRegEx; MatchCollection matches = regEx.Matches(html); int diff = 0; *************** *** 200,204 **** case "select": Group selInner = match.Groups["inner"]; ! Regex regExOpt = MagicAjaxModule.FormElementOptionSelectedRegEx; //now remove the 'selected' attributes within this <select> tag --- 208,212 ---- case "select": Group selInner = match.Groups["inner"]; ! Regex regExOpt = Util.FormElementOptionSelectedRegEx; //now remove the 'selected' attributes within this <select> tag Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** MagicAjaxModule.cs 20 Dec 2005 23:51:40 -0000 1.45 --- MagicAjaxModule.cs 21 Dec 2005 00:40:23 -0000 1.46 *************** *** 61,90 **** private MagicAjaxContext _magicAjaxContext; - #region Global Regular Expressions - private static RegexOptions options = RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture; - private Regex _formElementRegEx = new Regex(Util.FormElementPattern, options); - private Regex _formElementOptionsRegEx = new Regex("<option\\s((?<attrname>[-\\w]+)=\"(?<attrvalue>.*?)\"\\s?)*\\s*>.*?</option>", options); - private Regex _formElementOptionSelectedRegEx = new Regex(@"<option.*?(?<selected>selected=(""|'|)selected(""|'|)(\s+|(?=>))).*?>", options); - private Regex _scriptPattern = new Regex(Util.ScriptPattern, RegexOptions.IgnoreCase); - - public static Regex FormElementRegEx - { - get { return (Regex)HttpContext.Current.Items["FormElementRegEx"]; } - } - public static Regex FormElementOptionsRegEx - { - get { return (Regex)HttpContext.Current.Items["FormElementOptionsRegEx"]; } - } - public static Regex FormElementOptionSelectedRegEx - { - get { return (Regex)HttpContext.Current.Items["FormElementOptionSelectedRegEx"]; } - } - public static Regex ScriptPattern - { - get { return (Regex)HttpContext.Current.Items["ScriptPattern"]; } - } - - #endregion - #region IHttpModule implementation /// <summary> --- 61,64 ---- *************** *** 425,434 **** _response = context.Response; - // Init global Regular Expressions - context.Items.Add("FormElementRegEx", _formElementRegEx); - context.Items.Add("FormElementOptionsRegEx", _formElementOptionsRegEx); - context.Items.Add("FormElementOptionSelectedRegEx", _formElementOptionSelectedRegEx); - context.Items.Add("ScriptPattern", _scriptPattern); - // Create a new context and add it to the items collection for later retrieval // by MagicAjaxContext.Current --- 399,402 ---- |
From: Argiris K. <be...@us...> - 2005-12-21 00:40:31
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21640/Docs Modified Files: Changelog.html Log Message: Moved all RegExs to Util.cs as static objects. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Changelog.html 20 Dec 2005 23:51:40 -0000 1.16 --- Changelog.html 21 Dec 2005 00:40:23 -0000 1.17 *************** *** 58,61 **** --- 58,63 ---- <ul> <li> + Improved performance + <LI> There were conflicts with other HttpModules when they modified cookies; fixed it |
From: Argiris K. <be...@us...> - 2005-12-21 00:40:31
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21640/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Moved all RegExs to Util.cs as static objects. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** AjaxPanel.cs 20 Dec 2005 22:48:12 -0000 1.41 --- AjaxPanel.cs 21 Dec 2005 00:40:23 -0000 1.42 *************** *** 404,409 **** NameValueCollection form = Context.Request.Form; ! //here ! Regex regEx = MagicAjaxModule.FormElementRegEx; MatchCollection matches = regEx.Matches(html); for (int i=0; i<matches.Count; i++) --- 404,408 ---- NameValueCollection form = Context.Request.Form; ! Regex regEx = Util.FormElementRegEx; MatchCollection matches = regEx.Matches(html); for (int i=0; i<matches.Count; i++) *************** *** 482,486 **** case "select": ! Regex regExOpt = MagicAjaxModule.FormElementOptionsRegEx; bool multiple = attrNameValues.ContainsKey("multiple"); --- 481,485 ---- case "select": ! Regex regExOpt = Util.FormElementOptionsRegEx; bool multiple = attrNameValues.ContainsKey("multiple"); |
From: Argiris K. <be...@us...> - 2005-12-20 23:51:48
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6985/Core Modified Files: AjaxCallHelper.cs MagicAjaxModule.cs PageFilter.cs Log Message: There were conflicts with other HttpModules when they modified cookies; to fix it: --Removed all Response.Flush method calls --Moved the handling of the html page (i.e. retrieving the viewstate) at the Application_EndRequest method Index: PageFilter.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/PageFilter.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PageFilter.cs 20 Dec 2005 22:48:12 -0000 1.7 --- PageFilter.cs 20 Dec 2005 23:51:40 -0000 1.8 *************** *** 35,38 **** --- 35,39 ---- private Stream _responseStream; private Stream _memStream; + private MagicAjaxContext _magicAjaxContext; public PageFilter(Stream _responseStream) *************** *** 40,43 **** --- 41,45 ---- this._responseStream = _responseStream; this._memStream = new MemoryStream(); + this._magicAjaxContext = MagicAjaxContext.Current; } *************** *** 181,190 **** public override void Write(byte[] buffer, int offset, int count) { ! if (MagicAjaxContext.Current.IsAjaxCall) { ! _memStream.Write(buffer, offset, count); ! ! if (MagicAjaxContext.Current.CompletedAjaxCall) _responseStream.Write(buffer, offset, count); } else --- 183,192 ---- public override void Write(byte[] buffer, int offset, int count) { ! if (_magicAjaxContext.IsAjaxCall) { ! if (_magicAjaxContext.CompletedAjaxCall) _responseStream.Write(buffer, offset, count); + else + _memStream.Write(buffer, offset, count); } else Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AjaxCallHelper.cs 20 Dec 2005 13:11:07 -0000 1.15 --- AjaxCallHelper.cs 20 Dec 2005 23:51:40 -0000 1.16 *************** *** 430,435 **** MagicAjaxContext.Current.CompletedAjaxCall = true; - - hr.Flush(); hr.End(); } --- 430,433 ---- Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** MagicAjaxModule.cs 20 Dec 2005 22:48:12 -0000 1.44 --- MagicAjaxModule.cs 20 Dec 2005 23:51:40 -0000 1.45 *************** *** 55,58 **** --- 55,59 ---- { private bool _threadAbortExceptionThrown; + private bool _processedAjaxCall; private PageFilter _filter; private HttpRequest _request; *************** *** 420,423 **** --- 421,425 ---- // Init private fields _threadAbortExceptionThrown = false; + _processedAjaxCall = false; _request = context.Request; _response = context.Response; *************** *** 543,575 **** } #endif ! ! _response.Flush(); ! ! if ( ! viewStateIsExcluded ) ! { ! string vsValue = _filter.GetViewStateFieldValue(); ! if (vsValue != null && _request.Form["__VIEWSTATE"] != vsValue) ! { ! AjaxCallHelper.WriteSetFieldScript("__VIEWSTATE", vsValue); ! } ! } ! ! #if NET_2_0 ! // Check if this request is to add/remove/replace a WebPart ! // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_request.Form["__WPPS"])) ! { ! string wpmValue = _filter.GetWebPartManagerScriptValue(requestPage.Form.ClientID); ! if (wpmValue != null) ! { ! // Send script to cleanup current clientside WebPartManager object ! AjaxCallHelper.Write("if (typeof(WebPartManager_Cleanup) == 'function') { WebPartManager_Cleanup(); }"); ! ! // Send script to setup webpartmanager drag&drop + webpartmenu's ! AjaxCallHelper.Write(wpmValue); ! } ! } ! #endif ! AjaxCallHelper.End(); } } --- 545,550 ---- } #endif ! _processedAjaxCall = true; ! _response.End(); } } *************** *** 643,647 **** } ! AjaxCallHelper.End(); } } --- 618,623 ---- } ! _processedAjaxCall = true; ! _response.End(); } } *************** *** 662,680 **** try { ! if (_magicAjaxContext.IsAjaxCall && !_magicAjaxContext.CompletedAjaxCall && _threadAbortExceptionThrown) { ! // There was a Response.Redirect or Server.Transfer during AjaxCall ! ! if (_response.RedirectLocation != null) { ! // Handle Response.Redirect ! AjaxCallHelper.Redirect (_response.RedirectLocation); } ! else { ! // Handle Server.Transfer ! AjaxCallHelper.Init(); ! if (_filter != null) { string html = _filter.GetHtmlPage(); if (_request.Browser != null && _request.Browser.Browser == "IE") --- 638,689 ---- try { ! if ( _magicAjaxContext.IsAjaxCall ) { ! if ( _processedAjaxCall ) { ! // If the ViewState wasn't excluded from the post data, retrieve ! // it and send it to client. ! if ( _magicAjaxContext.IsPageNoStoreMode && _request.Form["__VIEWSTATE"] != null ) ! { ! string vsValue = _filter.GetViewStateFieldValue(); ! if (vsValue != null && _request.Form["__VIEWSTATE"] != vsValue) ! { ! AjaxCallHelper.WriteSetFieldScript("__VIEWSTATE", vsValue); ! } ! } ! ! #if NET_2_0 ! // Check if this request is to add/remove/replace a WebPart ! // If so, send back updated WebPartManager drag&drop javascript (IE only) ! if (!string.IsNullOrEmpty(_request.Form["__WPPS"])) ! { ! string wpmValue = _filter.GetWebPartManagerScriptValue(requestPage.Form.ClientID); ! if (wpmValue != null) ! { ! // Send script to cleanup current clientside WebPartManager object ! AjaxCallHelper.Write("if (typeof(WebPartManager_Cleanup) == 'function') { WebPartManager_Cleanup(); }"); ! ! // Send script to setup webpartmanager drag&drop + webpartmenu's ! AjaxCallHelper.Write(wpmValue); ! } ! } ! #endif ! ! AjaxCallHelper.End(); ! } ! else if ( _threadAbortExceptionThrown && !_magicAjaxContext.CompletedAjaxCall ) { ! // There was a Response.Redirect or Server.Transfer during AjaxCall ! ! if (_response.RedirectLocation != null) ! { ! // Handle Response.Redirect ! AjaxCallHelper.Redirect (_response.RedirectLocation); ! } ! else { + // Handle Server.Transfer + AjaxCallHelper.Init(); string html = _filter.GetHtmlPage(); if (_request.Browser != null && _request.Browser.Browser == "IE") *************** *** 688,693 **** } AjaxCallHelper.WriteSetHtmlOfPageScript(html); } - AjaxCallHelper.End(); } } --- 697,703 ---- } AjaxCallHelper.WriteSetHtmlOfPageScript(html); + + AjaxCallHelper.End(); } } } |
From: Argiris K. <be...@us...> - 2005-12-20 23:51:48
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6985/Docs Modified Files: Changelog.html Log Message: There were conflicts with other HttpModules when they modified cookies; to fix it: --Removed all Response.Flush method calls --Moved the handling of the html page (i.e. retrieving the viewstate) at the Application_EndRequest method Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Changelog.html 20 Dec 2005 11:33:33 -0000 1.15 --- Changelog.html 20 Dec 2005 23:51:40 -0000 1.16 *************** *** 58,61 **** --- 58,64 ---- <ul> <li> + There were conflicts with other HttpModules when they modified cookies; fixed + it + <LI> Optimizations for the javascript client <LI> |
From: Dion O. <dol...@us...> - 2005-12-20 22:48:20
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23742/magicajax/Core Modified Files: MagicAjaxModule.cs PageFilter.cs Util.cs Log Message: Made all RegEx's used by MagicAjax global in MagicAjaxModule.cs. This improves performance with factor 15. Note: only the RegEx's used for filtering WebPartManager script is not made global yet. Index: PageFilter.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/PageFilter.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PageFilter.cs 20 Dec 2005 13:11:08 -0000 1.6 --- PageFilter.cs 20 Dec 2005 22:48:12 -0000 1.7 *************** *** 66,69 **** --- 66,70 ---- /// <summary> /// Look for javascript generated for draggable webparts (IE only), and returns these javascripts. + /// TODO: make used regular expressions global /// </summary> public string GetWebPartManagerScriptValue(string formID) Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Util.cs 12 Dec 2005 12:10:41 -0000 1.16 --- Util.cs 20 Dec 2005 22:48:12 -0000 1.17 *************** *** 52,56 **** { StringBuilder sb = new StringBuilder(html); ! MatchCollection scriptMatches = Regex.Matches(html, ScriptPattern, RegexOptions.IgnoreCase); int diff = 0; --- 52,59 ---- { StringBuilder sb = new StringBuilder(html); ! ! Regex regEx = MagicAjaxModule.ScriptPattern; ! MatchCollection scriptMatches = regEx.Matches(html); ! //MatchCollection scriptMatches = Regex.Matches(html, ScriptPattern, RegexOptions.IgnoreCase); int diff = 0; *************** *** 112,117 **** { StringBuilder strbuild = new StringBuilder(html); ! RegexOptions options = RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture; ! Regex regEx = new System.Text.RegularExpressions.Regex(Util.FormElementPattern, options); MatchCollection matches = regEx.Matches(html); int diff = 0; --- 115,119 ---- { StringBuilder strbuild = new StringBuilder(html); ! Regex regEx = MagicAjaxModule.FormElementOptionsRegEx; MatchCollection matches = regEx.Matches(html); int diff = 0; *************** *** 198,202 **** case "select": Group selInner = match.Groups["inner"]; ! Regex regExOpt = new System.Text.RegularExpressions.Regex(@"<option.*?(?<selected>selected=(""|'|)selected(""|'|)(\s+|(?=>))).*?>", options); //now remove the 'selected' attributes within this <select> tag --- 200,204 ---- case "select": Group selInner = match.Groups["inner"]; ! Regex regExOpt = MagicAjaxModule.FormElementOptionSelectedRegEx; //now remove the 'selected' attributes within this <select> tag Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** MagicAjaxModule.cs 18 Dec 2005 16:44:46 -0000 1.43 --- MagicAjaxModule.cs 20 Dec 2005 22:48:12 -0000 1.44 *************** *** 60,63 **** --- 60,89 ---- private MagicAjaxContext _magicAjaxContext; + #region Global Regular Expressions + private static RegexOptions options = RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture; + private Regex _formElementRegEx = new Regex(Util.FormElementPattern, options); + private Regex _formElementOptionsRegEx = new Regex("<option\\s((?<attrname>[-\\w]+)=\"(?<attrvalue>.*?)\"\\s?)*\\s*>.*?</option>", options); + private Regex _formElementOptionSelectedRegEx = new Regex(@"<option.*?(?<selected>selected=(""|'|)selected(""|'|)(\s+|(?=>))).*?>", options); + private Regex _scriptPattern = new Regex(Util.ScriptPattern, RegexOptions.IgnoreCase); + + public static Regex FormElementRegEx + { + get { return (Regex)HttpContext.Current.Items["FormElementRegEx"]; } + } + public static Regex FormElementOptionsRegEx + { + get { return (Regex)HttpContext.Current.Items["FormElementOptionsRegEx"]; } + } + public static Regex FormElementOptionSelectedRegEx + { + get { return (Regex)HttpContext.Current.Items["FormElementOptionSelectedRegEx"]; } + } + public static Regex ScriptPattern + { + get { return (Regex)HttpContext.Current.Items["ScriptPattern"]; } + } + + #endregion + #region IHttpModule implementation /// <summary> *************** *** 397,400 **** --- 423,432 ---- _response = context.Response; + // Init global Regular Expressions + context.Items.Add("FormElementRegEx", _formElementRegEx); + context.Items.Add("FormElementOptionsRegEx", _formElementOptionsRegEx); + context.Items.Add("FormElementOptionSelectedRegEx", _formElementOptionSelectedRegEx); + context.Items.Add("ScriptPattern", _scriptPattern); + // Create a new context and add it to the items collection for later retrieval // by MagicAjaxContext.Current |
From: Dion O. <dol...@us...> - 2005-12-20 22:48:20
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23742/magicajax/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Made all RegEx's used by MagicAjax global in MagicAjaxModule.cs. This improves performance with factor 15. Note: only the RegEx's used for filtering WebPartManager script is not made global yet. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** AjaxPanel.cs 20 Dec 2005 13:11:08 -0000 1.40 --- AjaxPanel.cs 20 Dec 2005 22:48:12 -0000 1.41 *************** *** 403,409 **** { NameValueCollection form = Context.Request.Form; ! RegexOptions options = RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture; ! ! Regex regEx = new System.Text.RegularExpressions.Regex(Util.FormElementPattern, options); MatchCollection matches = regEx.Matches(html); for (int i=0; i<matches.Count; i++) --- 403,409 ---- { NameValueCollection form = Context.Request.Form; ! ! //here ! Regex regEx = MagicAjaxModule.FormElementRegEx; MatchCollection matches = regEx.Matches(html); for (int i=0; i<matches.Count; i++) *************** *** 482,486 **** case "select": ! Regex regExOpt = new System.Text.RegularExpressions.Regex("<option\\s((?<attrname>[-\\w]+)=\"(?<attrvalue>.*?)\"\\s?)*\\s*>.*?</option>", options); bool multiple = attrNameValues.ContainsKey("multiple"); --- 482,486 ---- case "select": ! Regex regExOpt = MagicAjaxModule.FormElementOptionsRegEx; bool multiple = attrNameValues.ContainsKey("multiple"); |
From: Argiris K. <be...@us...> - 2005-12-20 13:11:18
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19720/Core/UI/Controls Modified Files: AjaxPanel.cs Log Message: Removed the 'script' postfix from the javascript functions. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** AjaxPanel.cs 18 Dec 2005 16:44:46 -0000 1.39 --- AjaxPanel.cs 20 Dec 2005 13:11:08 -0000 1.40 *************** *** 809,813 **** #region ExtendedWriteSetHtmlOfElementScript /// <summary> ! /// Calls the AJAXCbo.ExtendedSetHtmlOfElementScript function on the client. /// </summary> /// <remarks> --- 809,813 ---- #region ExtendedWriteSetHtmlOfElementScript /// <summary> ! /// Calls the AJAXCbo.ExtendedSetHtmlOfElement function on the client. /// </summary> /// <remarks> *************** *** 816,820 **** /// AjaxPanel doesn't include RenderedByScriptControl controls in the html rendering, /// to reduce the size of the javascript script sent to clients. ! /// AJAXCbo.ExtendedSetHtmlOfElementScript finds the RenderedByScriptControl controls /// that are missing from the html rendering, gets them from the page of the client /// and adds them in the appropriate place in the html rendering. --- 816,820 ---- /// AjaxPanel doesn't include RenderedByScriptControl controls in the html rendering, /// to reduce the size of the javascript script sent to clients. ! /// AJAXCbo.ExtendedSetHtmlOfElement finds the RenderedByScriptControl controls /// that are missing from the html rendering, gets them from the page of the client /// and adds them in the appropriate place in the html rendering. *************** *** 824,828 **** private void ExtendedWriteSetHtmlOfElementScript(string html, string elementID) { ! AjaxCallHelper.Write( String.Format("AJAXCbo.ExtendedSetHtmlOfElementScript({0},\"{1}\");\r\n", AjaxCallHelper.EncodeString(html), elementID) ); } #endregion --- 824,828 ---- private void ExtendedWriteSetHtmlOfElementScript(string html, string elementID) { ! AjaxCallHelper.Write( String.Format("AJAXCbo.ExtendedSetHtmlOfElement({0},\"{1}\");\r\n", AjaxCallHelper.EncodeString(html), elementID) ); } #endregion *************** *** 1238,1242 **** // The hidden field is already registered at OnLoad event. // Set its value by javascript. ! page.RegisterStartupScript(panelKey + "VALUESET", String.Format("<script type='text/javascript'>AJAXCbo.SetFieldIfEmptyScript(\"{0}\",{1});</script>", panelKey, AjaxCallHelper.EncodeString(serializedPanelFingerprints))); } --- 1238,1242 ---- // The hidden field is already registered at OnLoad event. // Set its value by javascript. ! page.RegisterStartupScript(panelKey + "VALUESET", String.Format("<script type='text/javascript'>AJAXCbo.SetFieldIfEmpty(\"{0}\",{1});</script>", panelKey, AjaxCallHelper.EncodeString(serializedPanelFingerprints))); } |
From: Argiris K. <be...@us...> - 2005-12-20 13:11:17
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19720/Core Modified Files: AjaxCallHelper.cs PageFilter.cs Log Message: Removed the 'script' postfix from the javascript functions. Index: PageFilter.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/PageFilter.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PageFilter.cs 4 Dec 2005 03:25:15 -0000 1.5 --- PageFilter.cs 20 Dec 2005 13:11:08 -0000 1.6 *************** *** 92,96 **** string elmID = matchDragElm.Groups["DragElmId"].Value; wpmScript.AppendLine(string.Format("if (document.getElementById('{0}') == null)", elmID)); ! wpmScript.AppendLine(string.Format(" AJAXCbo.AddElementScript('{0}','span','__DragHolder',{1},'null');", formID, AjaxCallHelper.EncodeString(matchDragElm.Value))); } --- 92,96 ---- string elmID = matchDragElm.Groups["DragElmId"].Value; wpmScript.AppendLine(string.Format("if (document.getElementById('{0}') == null)", elmID)); ! wpmScript.AppendLine(string.Format(" AJAXCbo.AddElement('{0}','span','__DragHolder',{1},'null');", formID, AjaxCallHelper.EncodeString(matchDragElm.Value))); } Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AjaxCallHelper.cs 5 Dec 2005 18:40:50 -0000 1.14 --- AjaxCallHelper.cs 20 Dec 2005 13:11:07 -0000 1.15 *************** *** 279,283 **** { string before = (beforeElemID != null) ? String.Format("\"{0}\"", beforeElemID) : "null"; ! Write( String.Format("AJAXCbo.AddElementScript(\"{0}\",\"{1}\",\"{2}\",{3},{4});\r\n", parentID, tagName, elementID, EncodeString(html), before) ); } --- 279,283 ---- { string before = (beforeElemID != null) ? String.Format("\"{0}\"", beforeElemID) : "null"; ! Write( String.Format("AJAXCbo.AddElement(\"{0}\",\"{1}\",\"{2}\",{3},{4});\r\n", parentID, tagName, elementID, EncodeString(html), before) ); } *************** *** 289,293 **** public static void WriteRemoveElementScript(string parentID, string elementID) { ! Write( String.Format("AJAXCbo.RemoveElementScript(\"{0}\",\"{1}\");\r\n", parentID, elementID) ); } --- 289,293 ---- public static void WriteRemoveElementScript(string parentID, string elementID) { ! Write( String.Format("AJAXCbo.RemoveElement(\"{0}\",\"{1}\");\r\n", parentID, elementID) ); } *************** *** 303,307 **** public static void WriteSetFieldScript(string fieldName, string fieldValue) { ! Write( String.Format("AJAXCbo.SetFieldScript(\"{0}\",{1});\r\n", fieldName, EncodeString(fieldValue)) ); } --- 303,307 ---- public static void WriteSetFieldScript(string fieldName, string fieldValue) { ! Write( String.Format("AJAXCbo.SetField(\"{0}\",{1});\r\n", fieldName, EncodeString(fieldValue)) ); } *************** *** 313,317 **** public static void WriteSetHtmlOfElementScript(string html, string elementID) { ! Write( String.Format("AJAXCbo.SetHtmlOfElementScript({0},\"{1}\");\r\n", EncodeString(html), elementID) ); } --- 313,317 ---- public static void WriteSetHtmlOfElementScript(string html, string elementID) { ! Write( String.Format("AJAXCbo.SetHtmlOfElement({0},\"{1}\");\r\n", EncodeString(html), elementID) ); } |
From: Argiris K. <be...@us...> - 2005-12-20 13:11:17
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19720/Core/script Modified Files: AjaxCallObject.js Log Message: Removed the 'script' postfix from the javascript functions. Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AjaxCallObject.js 20 Dec 2005 11:33:33 -0000 1.33 --- AjaxCallObject.js 20 Dec 2005 13:11:08 -0000 1.34 *************** *** 680,684 **** } ! AjaxCallObject.prototype.AddElementScript = function(parentID, tagName, elementID, html, beforeElemID) { var place = document.getElementById(parentID); --- 680,684 ---- } ! AjaxCallObject.prototype.AddElement = function(parentID, tagName, elementID, html, beforeElemID) { var place = document.getElementById(parentID); *************** *** 693,700 **** } else ! this.SetHtmlOfElementScript (html, elementID); } ! AjaxCallObject.prototype.RemoveElementScript = function(parentID, elementID) { var place = document.getElementById(parentID); --- 693,700 ---- } else ! this.SetHtmlOfElement(html, elementID); } ! AjaxCallObject.prototype.RemoveElement = function(parentID, elementID) { var place = document.getElementById(parentID); *************** *** 704,708 **** } ! AjaxCallObject.prototype.SetFieldScript = function(fieldName, fieldValue) { var field = document.forms[0][fieldName]; --- 704,708 ---- } ! AjaxCallObject.prototype.SetField = function(fieldName, fieldValue) { var field = document.forms[0][fieldName]; *************** *** 711,715 **** } ! AjaxCallObject.prototype.SetFieldIfEmptyScript = function(fieldName, fieldValue) { var field = document.forms[0][fieldName]; --- 711,715 ---- } ! AjaxCallObject.prototype.SetFieldIfEmpty = function(fieldName, fieldValue) { var field = document.forms[0][fieldName]; *************** *** 718,722 **** } ! AjaxCallObject.prototype.SetHtmlOfElementScript = function(html, elementID) { var place = document.getElementById(elementID); --- 718,722 ---- } ! AjaxCallObject.prototype.SetHtmlOfElement = function(html, elementID) { var place = document.getElementById(elementID); *************** *** 745,749 **** // It's used by AjaxPanel ! AjaxCallObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { var place=document.getElementById(elementID); --- 745,749 ---- // It's used by AjaxPanel ! AjaxCallObject.prototype.ExtendedSetHtmlOfElement = function(html, elementID) { var place=document.getElementById(elementID); |
From: Argiris K. <be...@us...> - 2005-12-20 11:33:52
|
Update of /cvsroot/magicajax/magicajax/Docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28492/Docs Modified Files: Changelog.html Log Message: Optimised the ExtendedSetHtmlOfElement function. Index: Changelog.html =================================================================== RCS file: /cvsroot/magicajax/magicajax/Docs/Changelog.html,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Changelog.html 13 Dec 2005 06:35:57 -0000 1.14 --- Changelog.html 20 Dec 2005 11:33:33 -0000 1.15 *************** *** 58,64 **** <ul> <li> DropdownList and single-selection ListBox were not cleared for firefox; fixed it ! </li> </ul> <P class="MainHeader" align="left">v0.2.2 (12 December 2005) - Maintenance Release</P> --- 58,66 ---- <ul> <li> + Optimizations for the javascript client + <LI> DropdownList and single-selection ListBox were not cleared for firefox; fixed it ! </LI> </ul> <P class="MainHeader" align="left">v0.2.2 (12 December 2005) - Maintenance Release</P> |
From: Argiris K. <be...@us...> - 2005-12-20 11:33:47
|
Update of /cvsroot/magicajax/magicajax/Core/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28492/Core/script Modified Files: AjaxCallObject.js Log Message: Optimised the ExtendedSetHtmlOfElement function. Index: AjaxCallObject.js =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** AjaxCallObject.js 18 Dec 2005 16:44:47 -0000 1.32 --- AjaxCallObject.js 20 Dec 2005 11:33:33 -0000 1.33 *************** *** 747,767 **** AjaxCallObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { ! var store = document.createElement("span"); ! store.innerHTML = html; ! var spans = store.getElementsByTagName("span"); ! for (var i=0; i < spans.length; i++) { ! var elem = spans[i]; ! if (elem.getAttribute("name") == "__ajaxmark") { ! var elemOnPage = document.getElementById(elem.id); ! if (elemOnPage != null) ! elem.innerHTML = elemOnPage.innerHTML; } - } ! var place=document.getElementById(elementID); ! if (place != null) ! place.innerHTML = store.innerHTML; } --- 747,782 ---- AjaxCallObject.prototype.ExtendedSetHtmlOfElementScript = function(html, elementID) { ! var place=document.getElementById(elementID); ! if (place != null) { ! var store = document.createElement(place.tagName); ! store.innerHTML = html; ! var markers = store.getElementsByTagName("span"); ! for (var i=markers.length-1; i >= 0; i--) { ! var elem = markers[i]; ! if (elem.getAttribute("name") == "__ajaxmark") ! { ! var elemOnPage = document.getElementById(elem.id); ! if (elemOnPage != null) ! elem.parentNode.replaceChild(elemOnPage, elem); ! } ! } ! ! if ("mergeAttributes" in store) ! { ! store.mergeAttributes(place, false); ! } ! else ! { ! for (var i=place.attributes.length-1; i >= 0; i--) ! { ! var attr = place.attributes[i]; ! store.setAttribute(attr.name, attr.value); ! } } ! place.parentNode.replaceChild(store, place); ! } } |
From: Argiris K. <be...@us...> - 2005-12-18 16:44:55
|
Update of /cvsroot/magicajax/magicajax/Core/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25522/Core/UI Modified Files: AjaxControl.cs RenderedByScriptControl.cs Log Message: -Added 'AjaxType' MagicAjax attribute for controls -Added 'ExcludeFlags' MagicAjax attribute for controls -Added AjaxZone control. Index: AjaxControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/AjaxControl.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AjaxControl.cs 30 Nov 2005 12:22:29 -0000 1.9 --- AjaxControl.cs 18 Dec 2005 16:44:46 -0000 1.10 *************** *** 34,37 **** --- 34,40 ---- { private MagicAjaxContext _magicAjaxContext; + private bool _isAjaxCall; + private bool _isPageNoStoreMode; + private bool _isInAjaxZone; /// <summary> *************** *** 64,68 **** public bool IsPageNoStoreMode { ! get { return HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode; } } --- 67,71 ---- public bool IsPageNoStoreMode { ! get { return _isPageNoStoreMode; } } *************** *** 73,86 **** public bool IsAjaxCall { ! get { return (HttpContext.Current != null && this.Page != null && MagicAjaxContext.Current.IsAjaxCallForPage(this.Page)); } } public AjaxControl() { - _magicAjaxContext = MagicAjaxContext.Current; } public AjaxControl(HtmlTextWriterTag tag) : base(tag) { - _magicAjaxContext = MagicAjaxContext.Current; } --- 76,93 ---- public bool IsAjaxCall { ! get { return _isAjaxCall; } ! } ! ! [Browsable(false),DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public bool IsInAjaxZone ! { ! get { return _isInAjaxZone; } } public AjaxControl() { } public AjaxControl(HtmlTextWriterTag tag) : base(tag) { } *************** *** 90,93 **** --- 97,106 ---- } + protected override void OnLoad(EventArgs e) + { + base.OnLoad (e); + InitAjaxIntrinsics(); + } + protected override void OnPreRender(EventArgs e) { *************** *** 105,108 **** --- 118,123 ---- protected virtual void OnAjaxCall(EventArgs e) { + InitAjaxIntrinsics(); + if (AjaxCall != null) AjaxCall(this, e); *************** *** 111,117 **** --- 126,155 ---- protected virtual void OnAjaxCallEnd(EventArgs e) { + _magicAjaxContext = null; + if (AjaxCallEnd != null) AjaxCallEnd(this, e); } + + protected virtual void InitAjaxIntrinsics() + { + _magicAjaxContext = MagicAjaxContext.Current; + _isAjaxCall = ( HttpContext.Current != null && this.Page != null && MagicAjaxContext.Current.IsAjaxCallForPage(this.Page) ); + _isPageNoStoreMode = ( HttpContext.Current != null && MagicAjaxContext.Current.IsPageNoStoreMode ); + + string ajaxZoneID = Context.Request.Form["__AJAXZONE"]; + _isInAjaxZone = ( ajaxZoneID == null || IsInAjaxZoneRecursive(this, ajaxZoneID) ); + } + + private bool IsInAjaxZoneRecursive (Control control, string ajaxZoneID) + { + if (control.ClientID == ajaxZoneID) + return true; + + if (control.Parent == null || control.Parent == control.Page) + return false; + + return IsInAjaxZoneRecursive(control.Parent, ajaxZoneID); + } } } Index: RenderedByScriptControl.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/RenderedByScriptControl.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RenderedByScriptControl.cs 30 Nov 2005 12:22:29 -0000 1.14 --- RenderedByScriptControl.cs 18 Dec 2005 16:44:46 -0000 1.15 *************** *** 298,301 **** --- 298,304 ---- public virtual void WriteScript() { + if ( ! this.IsInAjaxZone ) + return; + if ( ! this.Visible ) { |
From: Argiris K. <be...@us...> - 2005-12-18 16:44:55
|
Update of /cvsroot/magicajax/magicajax/Core/UI/Controls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25522/Core/UI/Controls Modified Files: AjaxPanel.cs Added Files: AjaxZone.cs Log Message: -Added 'AjaxType' MagicAjax attribute for controls -Added 'ExcludeFlags' MagicAjax attribute for controls -Added AjaxZone control. Index: AjaxPanel.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/UI/Controls/AjaxPanel.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AjaxPanel.cs 13 Dec 2005 06:23:02 -0000 1.38 --- AjaxPanel.cs 18 Dec 2005 16:44:46 -0000 1.39 *************** *** 113,139 **** public AjaxCallConnectionType AjaxCallConnection { ! get ! { ! return _ajaxCallConnection; ! } ! set ! { ! _ajaxCallConnection = value; ! ! switch (_ajaxCallConnection) ! { ! case AjaxCallConnectionType.None: ! this.Attributes.Remove ("AjaxCall"); ! break; ! ! case AjaxCallConnectionType.Asynchronous: ! this.Attributes["AjaxCall"] = "async"; ! break; ! ! case AjaxCallConnectionType.Synchronous: ! this.Attributes["AjaxCall"] = "sync"; ! break; ! } ! } } #endregion --- 113,118 ---- public AjaxCallConnectionType AjaxCallConnection { ! get { return _ajaxCallConnection; } ! set { _ajaxCallConnection = value; } } #endregion *************** *** 168,172 **** if ( IsPageNoStoreMode ) { ! return (HttpContext.Current.Request.Form[ControlCollectionState.GetControlFingerprintsField(this.ClientID)] != String.Empty); } else --- 147,151 ---- if ( IsPageNoStoreMode ) { ! return ( Context.Request.Form[ControlCollectionState.GetControlFingerprintsField(this.ClientID)] != String.Empty); } else *************** *** 206,209 **** --- 185,204 ---- #endregion + #region override OnPreRender + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender (e); + SetAjaxAttributes(); + } + #endregion + + #region override OnPreWriteScript + protected override void OnPreWriteScript(EventArgs e) + { + base.OnPreWriteScript (e); + SetAjaxAttributes(); + } + #endregion + #region override OnUnload protected override void OnUnload(EventArgs e) *************** *** 334,342 **** #endregion protected virtual void SaveControlState() { //note:only for NoStore mode ! _controlState.SetControlIDs(_controlHtmlFingerprints); ! _controlState.Save (this.ClientID, this.Page); } --- 329,358 ---- #endregion + protected virtual void SetAjaxAttributes() + { + switch (_ajaxCallConnection) + { + case AjaxCallConnectionType.None: + this.Attributes.Remove ("AjaxCall"); + break; + + case AjaxCallConnectionType.Asynchronous: + this.Attributes["AjaxCall"] = "async"; + break; + + case AjaxCallConnectionType.Synchronous: + this.Attributes["AjaxCall"] = "sync"; + break; + } + } + protected virtual void SaveControlState() { //note:only for NoStore mode ! if ( _controlState != null ) ! { ! _controlState.SetControlIDs(_controlHtmlFingerprints); ! _controlState.Save (this.ClientID, this.Page); ! } } *************** *** 347,351 **** if (_controlState == null) { ! throw new MagicAjaxException(String.Format("The control fingerprints for AjaxPanel '{0}' is not rendered on page.", this.ClientID)); } --- 363,370 ---- if (_controlState == null) { ! // The control fingerprints were excluded from the post data. ! // There will be no evaluation of 'html holders'; all the contents ! // of the AjaxPanel will be sent to client in one javascript command. ! return; } *************** *** 621,625 **** bool allControlsAreNew = (Controls.Count == _addedControls.Count); ! if ( ! this.IsRenderedOnPage || allControlsAreNew ) { // Render all the controls in a single html rendering. --- 640,644 ---- bool allControlsAreNew = (Controls.Count == _addedControls.Count); ! if ( ! this.IsRenderedOnPage || allControlsAreNew || _controlState == null ) { // Render all the controls in a single html rendering. *************** *** 668,672 **** } ! _controlState.LiteralFingerprint = Util.GetFingerprint(sbLiteral.ToString()); } else --- 687,692 ---- } ! if ( _controlState != null ) ! _controlState.LiteralFingerprint = Util.GetFingerprint(sbLiteral.ToString()); } else --- NEW FILE: AjaxZone.cs --- using System; using System.Web.UI; using System.ComponentModel; namespace MagicAjax.UI.Controls { public enum ExcludeFromPostFlag { /// <summary> /// Post all elements /// </summary> None = 0, /// <summary> /// Do not post ViewState /// </summary> ViewState = 1, /// <summary> /// Do not post the control fingerprints hidden fields /// </summary> Fingerprints = 2, /// <summary> /// Do not post the custom hidden fields of the user /// </summary> UserHidden = 4, /// <summary> /// Do not post any hidden field /// </summary> AllHidden = 7, /// <summary> /// Do not post any (non-hidden) form element /// </summary> FormElements = 8, /// <summary> /// Do not post any element /// </summary> AllElements = 15 } /// <summary> /// Summary description for AjaxZone. /// </summary> public class AjaxZone : AjaxPanel { private ExcludeFromPostFlag _excludeFlags = ExcludeFromPostFlag.None; [Bindable(false), Category("Behaviour"), DefaultValue(ExcludeFromPostFlag.None)] public ExcludeFromPostFlag ExcludeFlags { get { return _excludeFlags; } set { _excludeFlags = value; } } protected override void SetAjaxAttributes() { base.SetAjaxAttributes (); if (_excludeFlags == ExcludeFromPostFlag.None) { this.Attributes.Remove ("ExcludeFlags"); } else { this.Attributes["ExcludeFlags"] = ((int)_excludeFlags).ToString(); } } protected override void OnLoad(EventArgs e) { base.OnLoad (e); this.Attributes["AjaxType"] = "ajaxzone"; } } } |