Ask a Question related to ASP.NET General, Design and Development.
-
Mark Kamoski #1
Re: how to change an image url at runtime
....argghhh...
....still cannot figure this out...
....any help is appreciated...
"Mark Kamoski" <mkamoski@yahoo.com> wrote in message
news:Ok6ouJsTDHA.3192@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" <jon@REMOVE.ME.PLEASE.jondavis.net> wrote in message
news:O%23QTT3nTDHA.2008@TK2MSFTNGP11.phx.gbl...
Try:
Response.Write("<script>TopBanner.src =
\"http://www.site.com/image.gif\";</script>");
Jon
"Mark Kamoski" <mkamoski@yahoo.com> wrote in message
news:%23n4MOvmTDHA.3088@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.
>
>
>
Mark Kamoski Guest
-
runtime formating change
I have a datagrid where I specified {0:###,###,###} at design time. However sometimes I am putting percentages in the grid instead of money and I... -
How to change the URL of a web reference at runtime?
Hi - How can you change the web reference URL that a client is using to access a web service at runtime? thanks -
change fps in runtime??
hi ng is it possible to change the frames per second moviespeed via actionscript? cheers jens -
Change cast members at runtime
Is it possible to permanently change the contents of castlibs or castmembers at runtime? Or are all changes only in memory? For example, what if...



Reply With Quote

