....argghhh...
....still cannot figure this out...
....any help is appreciated...
"Mark Kamoski" <mk******@yahoo.com> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Ugg.
Is there another way to do this without using Response.Write?
Why doesn't something like this work?
This code is in the code-behind for the user control for the Nav, which
SHOULD swap the a top banner image.
Why doesn't it work?
What do you think?
(Note-- I don't see where a Response.Write will help in this case.
(I suspect this has something to do with postback, the event cycle of the
host page, the event cycle of the user control, or something related to
these-- but, I don't know exactly where.)
//This is an image button event handler that exists in the user control.
//The image button exists on the user control.
//
private void ShowFeedback_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
ShowBanner("Feedback");
Response.Redirect("Feedback.aspx?Nav=Feedback");
}
//This is the helper method that exists in the user control.
//
private void ShowBanner(string NavValue)
{
TopBanner.ImageUrl = "Images/BannerTop" + NavValue + ".gif";
}
"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...
Try:
Response.Write("<script>TopBanner.src =
\"http://www.site.com/image.gif\";</script>");
Jon
"Mark Kamoski" <mk******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How can one change an image url at runtime?
(Note, the image exists in a user control.)
This is the image tag on the ascx...
<asp:image id="TopBanner" runat="server"></asp:image>
...but I cannot get this to change from the code behind of a page that
hosts the user control.
Any ideas?
Thanks.