importing messaging-2008 branch to trunk.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlImage.cs
index 2dbedd1945d7ca4316e13d2bcb6e0f7b32b36d6c..7bf0cdff03534fdaa9239295c89471d35468f795 100644 (file)
@@ -150,6 +150,9 @@ namespace System.Web.UI.HtmlControls
                [WebSysDescription("")]
                [WebCategory("Behavior")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+#if NET_2_0
+               [UrlProperty]
+#endif
                public string Src 
                {
                        get {
@@ -198,6 +201,15 @@ namespace System.Web.UI.HtmlControls
                protected override void RenderAttributes (HtmlTextWriter w)
                {
                        PreProcessRelativeReference (w, "src");
+
+                       /* MS does not seem to render the src attribute if it
+                        * is empty. Firefox, at least, will fetch the current
+                        * page as the src="" if other img attributes exist.
+                        */
+                       string src = Attributes["src"];
+                       if (src == null || src.Length == 0)
+                               Attributes.Remove ("src");
+
                        base.RenderAttributes (w);
 
                        /* MS closes the HTML element at the end of