|
|
@@ -115,6 +115,9 @@ namespace System.Web.UI.HtmlControls {
|
|
|
override void OnPreRender (EventArgs e)
|
|
|
{
|
|
|
base.OnPreRender (e);
|
|
|
+ if (Page != null) {
|
|
|
+ Page.RegisterRequiresPostBack (this);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
protected virtual void OnServerChange (EventArgs e)
|
|
|
@@ -123,17 +126,8 @@ namespace System.Web.UI.HtmlControls {
|
|
|
if (serverChange != null)
|
|
|
serverChange (this, e);
|
|
|
}
|
|
|
-#if NET_2_0
|
|
|
- protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
|
|
|
- {
|
|
|
- return DefaultLoadPostData (postDataKey, postCollection);
|
|
|
- }
|
|
|
|
|
|
- protected virtual void RaisePostDataChangedEvent ()
|
|
|
- {
|
|
|
- OnServerChange (EventArgs.Empty);
|
|
|
- }
|
|
|
-#else
|
|
|
+#if !NET_2_0
|
|
|
protected override void RenderAttributes (HtmlTextWriter writer)
|
|
|
{
|
|
|
// the Type property can be, indirectly, changed by using the Attributes property
|
|
|
@@ -145,22 +139,39 @@ namespace System.Web.UI.HtmlControls {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- internal bool DefaultLoadPostData (string postDataKey, NameValueCollection postCollection)
|
|
|
+ bool LoadPostDataInternal (string postDataKey, NameValueCollection postCollection)
|
|
|
{
|
|
|
string s = postCollection [postDataKey];
|
|
|
- if (Attributes ["value"] != s) {
|
|
|
- Attributes ["value"] = s;
|
|
|
+ if (Value != s) {
|
|
|
+ Value = s;
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ void RaisePostDataChangedEventInternal ()
|
|
|
+ {
|
|
|
+ OnServerChange (EventArgs.Empty);
|
|
|
+ }
|
|
|
+
|
|
|
+#if NET_2_0
|
|
|
+ protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
|
|
|
+ {
|
|
|
+ return LoadPostDataInternal (postDataKey, postCollection);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected virtual void RaisePostDataChangedEvent ()
|
|
|
+ {
|
|
|
+ RaisePostDataChangedEventInternal ();
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
|
|
|
{
|
|
|
#if NET_2_0
|
|
|
return LoadPostData (postDataKey, postCollection);
|
|
|
#else
|
|
|
- return DefaultLoadPostData (postDataKey, postCollection);
|
|
|
+ return LoadPostDataInternal (postDataKey, postCollection);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
@@ -169,7 +180,7 @@ namespace System.Web.UI.HtmlControls {
|
|
|
#if NET_2_0
|
|
|
RaisePostDataChangedEvent ();
|
|
|
#else
|
|
|
- OnServerChange (EventArgs.Empty);
|
|
|
+ RaisePostDataChangedEventInternal ();
|
|
|
#endif
|
|
|
}
|
|
|
|