i want to put a standard image control on my website , that will be able to show 8 photos by using a standard label and the ajax timer control , ( as Example : the first photo appears at 12:00 am , the second photo appears at 01:00 am , this time will be the text of the label and the photos will be changed by label's text changing ... )all this photo have the same extensions and will appear by the same image control ... If you please , tell me what should i do here , this code is as a try : <pre lang="c#"> Random _rand = new Random(); if (Label1.Text == "12:00 am") { Image1.ImageUrl = "`/Pics2/1.jpg"; int i = _rand.Next(1, 8); Image1.ImageUrl = "`/Pics2/" + i.ToString() + ".jpg"; } </pre> and that is another try : <pre lang="c#"> switch (Label1.Text) { case "08:55 ص": Image1.ImageUrl = "`/Pics2/1.jpg"; break; case "08:56 ص": Image1.ImageUrl = "`/Pics2/2.jpg"; break; case "08:57 ص": Image1.ImageUrl = "`/Pics2/2.jpg"; break; } </pre> as a note : that code was written by c# , and the controls is coded by asp.net (that label was inserted like that ) : <asp:UpdatePanel> <ContentTemplate> <asp:Label ID="Label1" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> ( and the image was inserted like that ) : <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> thanks very much , and sorry for long question , waiting your response ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)