简体   繁体   中英

asp:Image control showing empty placeholder when ImageUrl = string.Empty

I have an <asp:Image> control on my .aspx page. I have a function which programatically removes the image from the control by setting: myImage.ImageUrl = string.Empty . Problem is, after this procedure I am left with an empty placeholder:

在此处输入图片说明

How can I get rid of that placeholder?

To hide a control, set the property Visibile to false . This causes it not not be rendered at all, removing the tag completely from the resulting HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM