X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.UI.HtmlControls%2FHtmlImage.cs;h=7bf0cdff03534fdaa9239295c89471d35468f795;hb=a5e40870bd3bb18e1681afed6c71e7edfdb80534;hp=2dbedd1945d7ca4316e13d2bcb6e0f7b32b36d6c;hpb=efb51013c3b021d4a95f4cfbd9e8b64be5e475d2;p=mono.git diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs index 2dbedd1945d..7bf0cdff035 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs @@ -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