I have got the following code snippet in my page
<asp:UpdatePanel runat="server" ID="UpdatePanel1">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="testButton" />
</Triggers>
<ContentTemplate>
<asp:Image ID="testImage" runat="server" ImageUrl="~/triangle.png" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button runat="server" ID="testButton" Text="Change Image" OnClick="testButton_Click" />
and have got the following in my code behind
protected void testButton_Click ( object sender , EventArgs e ) {
testImage.ImageUrl = "";
}
When I click on the button, the image is vanished since its URL has been set to empty string in code behind - I understand that. But when I view the page source, I see the original image URL as initialized in the asp page where I badly need URL to be set to empty string.