importing messaging-2008 branch to trunk.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlImage.cs
index e72ba3e93af3405509da05072a3d7dbd226c893d..7bf0cdff03534fdaa9239295c89471d35468f795 100644 (file)
@@ -201,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