How to manipulate an image on the user control?

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

Hi,

I am a newbie and have a simple question?
I have a aspx file and on the form I have a user control which is my
header and has some images. Now for various pages I need to load
different images on the header. How to replace image "A" with image "B"
on the control programatically?

I Use C# and Visual Studio 2005.

Any help is greatly appreciated,
Tom
 
Hi
Define a property in the userControl that manipulate the Image. then in
the form's load event of the form write code to change image depend on
forms.

Write the following code in the UserControl( I assume that you use an
image control in the WebUseControl)

public string URL
{
get
{
return Image1.ImageUrl;
}
set
{
Image1.ImageUrl = value;
}
}

then write the following in the form load :
WebUserControl1.URL = "test.gif";

Best Regards,
A.Hadi
 
Back
Top