2006-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / CheckBoxList.cs
index 9b43e65aa42b71c537abbc85cdee95776d05feb7..463898453173abb1447891695b1e7a53e8588c16 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System;
 using System.Globalization;
 using System.Collections.Specialized;
 using System.ComponentModel;
-
+using System.Security.Permissions;
 
 namespace System.Web.UI.WebControls {
 
+       // CAS
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public class CheckBoxList : ListControl, IRepeatInfoUser,
                                    INamingContainer, IPostBackDataHandler {
 
@@ -236,6 +238,10 @@ namespace System.Web.UI.WebControls {
 #endif
                void RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       if (CausesValidation)
+                               Page.Validate (ValidationGroup);
+#endif
                        OnSelectedIndexChanged (EventArgs.Empty);
                }
 
@@ -336,6 +342,12 @@ namespace System.Web.UI.WebControls {
                        check_box.Text = item.Text;
                        check_box.AutoPostBack = AutoPostBack;
                        check_box.Checked = item.Selected;
+                       check_box.TextAlign = TextAlign;
+                       check_box.Enabled = Enabled;
+#if NET_2_0
+                       check_box.ValidationGroup = ValidationGroup;
+                       check_box.CausesValidation = CausesValidation;
+#endif
                        check_box.RenderControl (writer);
                }