[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[DefaultEvent ("ServerChange")]
+#if NET_2_0
+ [SupportsEventValidation]
+#endif
public class HtmlInputHidden : HtmlInputControl, IPostBackDataHandler {
- private static readonly object ServerChangeEvent = new object ();
+ static readonly object ServerChangeEvent = new object ();
public HtmlInputHidden () : base ("hidden")
{
{
string data = postCollection [postDataKey];
if (data != null && data != Value) {
+#if NET_2_0
+ ValidateEvent (postDataKey, String.Empty);
+#endif
Value = data;
return true;
}
bool IPostBackDataHandler.LoadPostData (string postDataKey,
NameValueCollection postCollection)
{
+#if NET_2_0
+ return LoadPostData (postDataKey, postCollection);
+#else
return LoadPostDataInternal (postDataKey, postCollection);
+#endif
}
void IPostBackDataHandler.RaisePostDataChangedEvent ()
{
+#if NET_2_0
+ RaisePostDataChangedEvent ();
+#else
RaisePostDataChangedEventInternal ();
+#endif
}
#if NET_2_0
+ protected override void RenderAttributes (HtmlTextWriter writer)
+ {
+ Page page = Page;
+ if (page != null)
+ page.ClientScript.RegisterForEventValidation (Name);
+ base.RenderAttributes (writer);
+ }
+
protected internal
#else
protected
override void OnPreRender (EventArgs e)
{
base.OnPreRender (e);
+
+ if (Page != null && !Disabled) {
+ Page.RegisterRequiresPostBack (this);
+#if NET_2_0
+ Page.RegisterEnabledControl (this);
+#endif
+ }
}
protected virtual void OnServerChange (EventArgs e)