views:

45

answers:

1

Hello all,

I have a page, which is called from 2 different functions. For each function, the page has to be display different image. I have 2 images.

On the aspx page, code is like this. Please help me out how to display different image for different functions!! Thanks Guys!!

+1  A: 

Assuming you have an image on your ASPX page like this

<asp:Image id="myImage" runat="server" />

You can dynamically change the ImageUrl property of the image on the server-side like:

protected void Page_Load(object sender, EventArgs e)
{
    // Your logic to detect which image to display goes here
    var imageUrl = GetMyImageUrl();

    myImage.ImageUrl = imageUrl;
}
Wallace Breza