X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.UI.HtmlControls%2FHtmlInputRadioButton.cs;h=ebcc5b80e9444cbf6e9703985d9db3287a378550;hb=4323fbeaebf249f016dfdd6dc9b3b52a515f87c4;hp=0b26f1ccf7291eb5744a7e514c7f9088d8b6ef81;hpb=648d00f2145eb50a2ae65a57b1891ab77b4db24e;p=mono.git 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 0b26f1ccf72..ebcc5b80e94 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs @@ -105,8 +105,11 @@ namespace System.Web.UI.HtmlControls { { base.OnPreRender (e); - if (Page != null) { + if (Page != null && !Disabled) { Page.RegisterRequiresPostBack (this); +#if NET_2_0 + Page.RegisterEnabledControl (this); +#endif } } @@ -123,48 +126,39 @@ namespace System.Web.UI.HtmlControls { if (Page != null) Page.ClientScript.RegisterForEventValidation (this.UniqueID, Value); #endif - writer.WriteAttribute ("value", Value); + writer.WriteAttribute ("value", Value, true); 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); + Checked = checkedOnClient; + return checkedOnClient; } -#endif - 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) { -#if NET_2_0 return LoadPostData (postDataKey, postCollection); -#else - return DefaultLoadPostData (postDataKey, postCollection); -#endif } void IPostBackDataHandler.RaisePostDataChangedEvent () { -#if NET_2_0 RaisePostDataChangedEvent (); -#else - OnServerChange (EventArgs.Empty); -#endif }