diff options
author | Vladimir Krasnov <krasnov@mono-cvs.ximian.com> | 2006-03-08 12:27:04 +0300 |
---|---|---|
committer | Vladimir Krasnov <krasnov@mono-cvs.ximian.com> | 2006-03-08 12:27:04 +0300 |
commit | 4ae28b0a544b293cf05edbcf0bec1a462ffe676f (patch) | |
tree | 55f1bcf54b573ffe6f9a38b1396c46b1b54c3395 /mcs | |
parent | 3d7bc1eeb7b510532f39c2d23ea71a1db606443d (diff) |
* TextBox.cs: fixed missing value validations,
fixed rendering of empty value attribute
svn path=/trunk/mcs/; revision=57686
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index 67f5fa5fef5..a3b7a48eb4a 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,8 @@ +2006-03-08 Vladimir Krasnov <vladimirk@mainsoft.com> + + * TextBox.cs: fixed missing value validations, fixed rendering + of empty value attribute + 2006-03-07 Chris Toshok <toshok@ximian.com> * WebControl.cs (EnableTheming): leave the MonoTODO, but implement diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs index 81a6a890f8d..5b5669fa1db 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs @@ -79,7 +79,8 @@ namespace System.Web.UI.WebControls { w.AddAttribute (HtmlTextWriterAttribute.Type, "password"); else { w.AddAttribute (HtmlTextWriterAttribute.Type, "text"); - w.AddAttribute (HtmlTextWriterAttribute.Value, Text); + if (Text.Length > 0) + w.AddAttribute (HtmlTextWriterAttribute.Value, Text); } if (Columns != 0) @@ -231,7 +232,10 @@ namespace System.Web.UI.WebControls { return ViewState.GetInt ("Columns", 0); } set { - ViewState ["Columns"] = value; + if (value < 0) + throw new ArgumentOutOfRangeException("value", "Columns value has to be 0 for 'not set' or bigger than 0."); + else + ViewState ["Columns"] = value; } } @@ -249,7 +253,10 @@ namespace System.Web.UI.WebControls { return ViewState.GetInt ("MaxLength", 0); } set { - ViewState ["MaxLength"] = value; + if (value < 0) + throw new ArgumentOutOfRangeException("value", "MaxLength value has to be 0 for 'not set' or bigger than 0."); + else + ViewState ["MaxLength"] = value; } } @@ -283,7 +290,10 @@ namespace System.Web.UI.WebControls { return ViewState.GetInt ("Rows", 0); } set { - ViewState ["Rows"] = value; + if (value < 0) + throw new ArgumentOutOfRangeException("value", "Rows value has to be 0 for 'not set' or bigger than 0."); + else + ViewState ["Rows"] = value; } } |