ajax image slider

  ----------------------------------image slider ajax control---------------------------------------------
step.1.==drag and drop scriptmanager and timer control and same way drag and drop image control
Step.2==create folder name as images and copy paste images give names like 1.jpg,2.jpg .....etc
then change propartys of timer control set
intervel=1000


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        getimage();
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        getimage();


    }

    private void getimage()
    {
        Random RAN = new Random();
        int i = RAN.Next(1, 9);
        Image1.ImageUrl = "~/images/" + i.ToString() + ".jpg";
    }
}
----------------------------------------------------------------------------------------------------------
aspx:
 <div>
    <table>
    <tr>
    <td>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Timer ID="Timer1" runat="server" Interval="10000" ontick="Timer1_Tick">
        </asp:Timer>
        <asp:Image ID="Image1" runat="server" />
    </td></tr></table>
   
    </div>



Comments

Popular posts from this blog

How to write Pure java script Program?