asp.net C# variable as Image1.ImageUrl property
Posted
by
ModS
on Stack Overflow
See other posts from Stack Overflow
or by ModS
Published on 2012-11-05T04:07:41Z
Indexed on
2012/11/05
5:00 UTC
Read the original article
Hit count: 145
I would like to Click "buttonImage1" and have that store "photos/Image1.jpg"
into a var called Photo. then have ButtonImage2.ImageUrl = (Photo)
.
I am using an UpdatePanel
to refresh the area with the images so the only problem is actually setting the variable correctly and then using it correctly.
Reworded: how can I store a path to an image in a variable then set it correctly as a image's URL path?
protected void Button2_Click(object sender, ImageClickEventArgs e)
{
Evt = ("~/events/ev2.jpg");
}
protected void Image2_Click(object sender, ImageClickEventArgs e)
{
Image1.ImageUrl = (Evt);
}
© Stack Overflow or respective owner