Hi,
you could have a property in the UC which is mapped to the ImageUrl (e.g if
you have a Image control in the user control) and this property could be set
by the Page. If you have Image with ID "Image1" in the user control, you
could have a property
public string ImageUrl
{
get
{
return Image1.ImageUrl;
}
set
{
Image1.ImageUrl = value;
}
}
And this then could be set by the Page with <UserControlID>.ImageUrl="url to
the img"; For example if you have it on Page
<uc1:WebUserControl1 ID="ucHeader" runat="server" />
then set in code
ucHeader.ImageUrl = "images/image.gif";
(you would need to have a member with UC's type in page's code-behind if you
use ASP.NET 1.1)
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"tom" <as**@adsf.com> wrote in message
news:XQ*******************@news20.bellglobal.com.. .
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