1 /* System.Web.UI.HtmlControls
3 * Leen Toelen (toelen@hotmail.com)
7 using System
.Collections
.Specialized
;
8 using System
.ComponentModel
;
9 using System
.Globalization
;
13 namespace System
.Web
.UI
.HtmlControls
{
15 [DefaultEvent("ServerChange")]
16 public class HtmlInputHidden
: HtmlInputControl
, IPostBackDataHandler
{
18 private static readonly object EventServerChange
= new object ();
20 public HtmlInputHidden () : base ("hidden")
24 bool IPostBackDataHandler
.LoadPostData (string postDataKey
,
25 NameValueCollection postCollection
)
27 string postValue
= postCollection
[postDataKey
];
28 if (postValue
!= null)
33 void IPostBackDataHandler
.RaisePostDataChangedEvent ()
35 // don't need anything. LoadPostData always returns false.
38 protected virtual void OnServerChange (EventArgs e
)
40 EventHandler handler
= (EventHandler
) Events
[EventServerChange
];
45 protected override void OnPreRender(EventArgs e
){
46 if (Events
[EventServerChange
] != null && !Disabled
)
47 ViewState
.SetItemDirty("value",false);
50 [WebCategory("Action")]
51 [WebSysDescription("Fires when the value of the control changes.")]
52 public event EventHandler ServerChange
{
54 Events
.AddHandler(EventServerChange
, value);
57 Events
.RemoveHandler(EventServerChange
, value);
61 } // class HtmlInputFile
62 } // namespace System.Web.UI.HtmlControls