use ResolveClientUrl instead of ResolveUrl to be complient with MS.NET
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / WebControl.cs
index 850015d346af60cb0b5820f0a3dd204e2328bfd1..cd1332cdc564bffed4d1f707302230b8a049b347 100644 (file)
@@ -34,13 +34,12 @@ namespace System.Web.UI.WebControls {
        [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;
@@ -92,7 +91,7 @@ namespace System.Web.UI.WebControls {
                public AttributeCollection Attributes {
                        get {
                                if (attributes == null) {
-                                       attribute_state = new StateBag ();
+                                       attribute_state = new StateBag (true);
                                        if (IsTrackingViewState)
                                                attribute_state.TrackViewState ();
                                        
@@ -249,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         
 
@@ -327,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         
                
@@ -499,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)