// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Collections.Specialized;
using System.Globalization;
using System.Security.Permissions;
+using System.Web.Util;
-namespace System.Web.UI.HtmlControls {
-
+namespace System.Web.UI.HtmlControls
+{
// CAS
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[DefaultEvent ("ServerChange")]
[ValidationProperty ("Value")]
-#if NET_2_0
[SupportsEventValidation]
-#endif
public class HtmlInputText : HtmlInputControl, IPostBackDataHandler
{
static readonly object serverChangeEvent = new object ();
}
}
-#if NET_2_0
[DefaultValue (-1)]
-#else
- [DefaultValue ("")]
-#endif
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[WebSysDescription("")]
[WebCategory("Appearance")]
}
}
-
-#if NET_2_0
protected internal override void Render (HtmlTextWriter writer)
{
- Page.ClientScript.RegisterForEventValidation (UniqueID);
+ Page page = Page;
+ if (page != null)
+ page.ClientScript.RegisterForEventValidation (UniqueID);
base.Render (writer);
}
-#endif
-#if NET_2_0
- protected internal
-#else
- protected
-#endif
- override void OnPreRender (EventArgs e)
+ protected internal override void OnPreRender (EventArgs e)
{
base.OnPreRender (e);
- if (Page != null && !Disabled) {
- Page.RegisterRequiresPostBack (this);
-#if NET_2_0
- Page.RegisterEnabledControl (this);
-#endif
+
+ Page page = Page;
+ if (page != null && !Disabled) {
+ page.RegisterRequiresPostBack (this);
+ page.RegisterEnabledControl (this);
}
}
protected override void RenderAttributes (HtmlTextWriter writer)
{
// the Type property can be, indirectly, changed by using the Attributes property
- if (String.Compare (Type, 0, "password", 0, 8, true, CultureInfo.InvariantCulture) == 0) {
+ if (String.Compare (Type, 0, "password", 0, 8, true, Helpers.InvariantCulture) == 0) {
Attributes.Remove ("value");
}
OnServerChange (EventArgs.Empty);
}
-#if NET_2_0
protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
{
return LoadPostDataInternal (postDataKey, postCollection);
ValidateEvent (UniqueID, String.Empty);
RaisePostDataChangedEventInternal ();
}
-#endif
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
}
-
[WebSysDescription("")]
[WebCategory("Action")]
public event EventHandler ServerChange {