projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
importing messaging-2008 branch to trunk.
[mono.git]
/
mcs
/
class
/
System.Web
/
System.Web.UI.HtmlControls
/
HtmlInputRadioButton.cs
diff --git
a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
index 2912384b2c2ecb31e962a49592e1e7046423e762..15589da533f65ea9b6927d1734bd74876395f3f8 100644
(file)
--- a/
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
+++ b/
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
@@
-40,17
+40,15
@@
namespace System.Web.UI.HtmlControls {
#if NET_2_0
[SupportsEventValidation]
#endif
#if NET_2_0
[SupportsEventValidation]
#endif
- public class HtmlInputRadioButton : HtmlInputControl, IPostBackDataHandler {
-
- private static readonly object serverChangeEvent = new object ();
-
+ public class HtmlInputRadioButton : HtmlInputControl, IPostBackDataHandler
+ {
+ static readonly object serverChangeEvent = new object ();
public HtmlInputRadioButton ()
: base ("radio")
{
}
public HtmlInputRadioButton ()
: base ("radio")
{
}
-
[DefaultValue ("")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[WebSysDescription("")]
[DefaultValue ("")]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[WebSysDescription("")]
@@
-96,7
+94,6
@@
namespace System.Web.UI.HtmlControls {
}
}
}
}
-
#if NET_2_0
protected internal
#else
#if NET_2_0
protected internal
#else
@@
-106,8
+103,11
@@
namespace System.Web.UI.HtmlControls {
{
base.OnPreRender (e);
{
base.OnPreRender (e);
- if (Page != null) {
+ if (Page != null
&& !Disabled
) {
Page.RegisterRequiresPostBack (this);
Page.RegisterRequiresPostBack (this);
+#if NET_2_0
+ Page.RegisterEnabledControl (this);
+#endif
}
}
}
}
@@
-120,48
+120,46
@@
namespace System.Web.UI.HtmlControls {
protected override void RenderAttributes (HtmlTextWriter writer)
{
protected override void RenderAttributes (HtmlTextWriter writer)
{
- writer.WriteAttribute ("value", Value);
+#if NET_2_0
+ if (Page != null)
+ Page.ClientScript.RegisterForEventValidation (this.UniqueID, Value);
+#endif
+ writer.WriteAttribute ("value", Value, true);
Attributes.Remove ("value");
base.RenderAttributes (writer);
}
#if NET_2_0
Attributes.Remove ("value");
base.RenderAttributes (writer);
}
#if NET_2_0
- protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
+ protected virtual
+#endif
+ bool LoadPostData (string postDataKey, NameValueCollection postCollection)
{
{
- return DefaultLoadPostData (postDataKey, postCollection);
- }
+ bool checkedOnClient = postCollection [Name] == Value;
+ if (Checked == checkedOnClient)
+ return false;
- protected virtual void RaisePostDataChangedEvent ()
- {
- OnServerChange (EventArgs.Empty);
- }
+#if NET_2_0
+ ValidateEvent (UniqueID, Value);
#endif
#endif
+ Checked = checkedOnClient;
+ return checkedOnClient;
+ }
- internal bool DefaultLoadPostData (string postDataKey, NameValueCollection postCollection)
+#if NET_2_0
+ protected virtual
+#endif
+ void RaisePostDataChangedEvent ()
{
{
- string s = postCollection [postDataKey];
- if ((s != null) && (Attributes ["value"] != postDataKey)) {
- Attributes ["value"] = postDataKey;
- // this doesn't seems to trigger a change
- }
- return false;
+ OnServerChange (EventArgs.Empty);
}
bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
{
}
bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
{
-#if NET_2_0
return LoadPostData (postDataKey, postCollection);
return LoadPostData (postDataKey, postCollection);
-#else
- return DefaultLoadPostData (postDataKey, postCollection);
-#endif
}
void IPostBackDataHandler.RaisePostDataChangedEvent ()
{
}
void IPostBackDataHandler.RaisePostDataChangedEvent ()
{
-#if NET_2_0
RaisePostDataChangedEvent ();
RaisePostDataChangedEvent ();
-#else
- OnServerChange (EventArgs.Empty);
-#endif
}
}