00001 #if V2 00002 00003 using System; 00004 using System.ComponentModel; 00005 using System.Drawing; 00006 using System.Web.UI; 00007 using ASP = System.Web.UI.WebControls; 00008 00009 namespace Anthem 00010 { 00014 [ToolboxBitmap(typeof(ASP.HiddenField))] 00015 public class HiddenField : ASP.HiddenField, IUpdatableControl 00016 { 00017 #region Unique Anthem control code 00018 00019 private const string parentTagName = "span"; 00024 protected override void Render(HtmlTextWriter writer) 00025 { 00026 #if !V2 00027 bool DesignMode = this.Context == null; 00028 #endif 00029 if (!DesignMode) 00030 { 00031 Anthem.Manager.WriteBeginControlMarker(writer, parentTagName, this); 00032 } 00033 if (Visible) 00034 { 00035 base.Render(writer); 00036 } 00037 if (!DesignMode) 00038 { 00039 Anthem.Manager.WriteEndControlMarker(writer, parentTagName, this); 00040 } 00041 } 00042 00043 #endregion 00044 00045 #region IUpdatableControl implementation 00046 00060 [Category("Anthem")] 00061 [DefaultValue(false)] 00062 [Description("True if this control should be updated after each callback.")] 00063 public virtual bool AutoUpdateAfterCallBack 00064 { 00065 get 00066 { 00067 object obj = this.ViewState["AutoUpdateAfterCallBack"]; 00068 if (obj == null) 00069 return false; 00070 else 00071 return (bool)obj; 00072 } 00073 set 00074 { 00075 if (value) UpdateAfterCallBack = true; 00076 ViewState["AutoUpdateAfterCallBack"] = value; 00077 } 00078 } 00079 00080 private bool _updateAfterCallBack = false; 00081 00096 [Browsable(false)] 00097 [DefaultValue(false)] 00098 public virtual bool UpdateAfterCallBack 00099 { 00100 get { return _updateAfterCallBack; } 00101 set { _updateAfterCallBack = value; } 00102 } 00103 00104 #endregion 00105 00106 #region Common Anthem control code 00107 00113 protected override void OnLoad(EventArgs e) 00114 { 00115 base.OnLoad(e); 00116 Anthem.Manager.Register(this); 00117 } 00118 00119 #if V2 00123 public override void RenderControl(HtmlTextWriter writer) 00124 { 00125 base.Visible = true; 00126 base.RenderControl(writer); 00127 } 00128 #endif 00129 00137 public override bool Visible 00138 { 00139 get 00140 { 00141 #if !V2 00142 bool DesignMode = this.Context == null; 00143 #endif 00144 return Anthem.Manager.GetControlVisible(this, ViewState, DesignMode); 00145 } 00146 set { Anthem.Manager.SetControlVisible(ViewState, value); } 00147 } 00148 00149 #endregion 00150 } 00151 } 00152 00153 #endif