In my website, an image is needed to show and should change periodically .
I used the below code.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" OnTick="gettickvalue" Interval="2000">
</asp:Timer>
<asp:UpdatePanel ID="BannerPanel" runat="server" UpdateMode="Conditional">
<Triggers >
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Image ID="imgBanner" ImageUrl="~/images/banner_1.gif" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
In the code section add the following lines.
protected void gettickvalue(object sender, EventArgs e)
{
Random RandomNumber = new Random();
int n = RandomNumber.Next(1, 9);
imgBanner.ImageUrl = System.String.Concat("images/banner_", n.ToString(), ".gif");
}
*------*
But I can see in first a image is showing, after particular time delay image changed but immediately come another .So Can't see any image.
I increased interval to 5000 or above , but it is changed image coming time only.
How can set image appear 5-6 seconds .