use ResolveClientUrl instead of ResolveUrl to be complient with MS.NET
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / WebControl.cs
index 94757ac52f46308f6807849a32223821205ec987..cd1332cdc564bffed4d1f707302230b8a049b347 100644 (file)
 
 using System.ComponentModel;
 using System.Drawing;
+using System.Security.Permissions;
 
 namespace System.Web.UI.WebControls {
+
+       // CAS
+       [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       // attributes
+       [ParseChildren (true)]
 #if NET_2_0
        [PersistChildrenAttribute (false, false)]
-       [ParseChildrenAttribute (true, ChildControlType = typeof(Control))]
        [Themeable (true)]
 #else  
        [PersistChildrenAttribute (false)]
-       [ParseChildrenAttribute (true)]
 #endif         
        public class WebControl : Control, IAttributeAccessor {
                Style style;
@@ -193,6 +198,9 @@ namespace System.Web.UI.WebControls {
 
                [Browsable(false)]
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#if NET_2_0
+               [EditorBrowsable (EditorBrowsableState.Never)]
+#endif
                public bool ControlStyleCreated {
                        get {
                                return style != null;
@@ -240,12 +248,8 @@ namespace System.Web.UI.WebControls {
                [MonoTODO]
                public virtual new bool EnableTheming
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-                       set {
-                               throw new NotImplementedException ();
-                       }
+                       get { return base.EnableTheming; }
+                       set { base.EnableTheming = value; }
                }
 #endif         
 
@@ -318,12 +322,8 @@ namespace System.Web.UI.WebControls {
                [MonoTODO]
                public virtual new string SkinID
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-                       set {
-                               throw new NotImplementedException ();
-                       }
+                       get { return base.SkinID; }
+                       set { base.SkinID = value; }
                }
 #endif         
                
@@ -490,8 +490,16 @@ namespace System.Web.UI.WebControls {
                        if (TabIndex != 0)
                                writer.AddAttribute (HtmlTextWriterAttribute.Tabindex, TabIndex.ToString ());
 
-                       if (style != null && !style.IsEmpty)
+                       if (style != null && !style.IsEmpty) {
+#if NET_2_0
+                               //unbelievable, but see WebControlTest.RenderBeginTag_BorderWidth_xxx
+                               if (TagKey == HtmlTextWriterTag.Span)
+                                       if (style.BorderWidth != Unit.Empty 
+                                               || style.BorderStyle != BorderStyle.NotSet)
+                                               writer.AddStyleAttribute (HtmlTextWriterStyle.Display, "inline-block");
+#endif
                                style.AddAttributesToRender(writer, this);
+                       }
 
                        if (attributes != null)
                                foreach(string s in attributes.Keys)