Automatically change DropDownList selected item on every 30 seconds using JavaScript in ASP.Net

Last Reply one year ago By dharmendr

Posted one year ago


I want change drop down list items automatically after 30 seconds. For example after run program show cars,after it show Animals till oceans when finished then start from cars automaticaly always must work like carousel images.

namespace AutoRefreshItems
    public partial class autoForm : System.Web.UI.Page
        protected void Page_Init(object sender, EventArgs e)
            DataTable dt = new DataTable();
            dt.Rows.Add("0", "Cars");
            dt.Rows.Add("1", "Animals");
            dt.Rows.Add("2", "Cumputers");
            dt.Rows.Add("3", "Televisions");
            dt.Rows.Add("4", "Oceans");
            drpList.DataSource = dt;
            drpList.DataTextField = "OptionText";
            drpList.DataValueField = "OptionValue";
        protected void Page_Load(object sender, EventArgs e)

        protected void drpList_SelectedIndexChanged(object sender, EventArgs e)
            Label1.Text = drpList.SelectedItem.Text;


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="autoForm.aspx.cs" Inherits="AutoRefreshItems.autoForm" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <form id="form1" runat="server">
        <asp:DropDownList ID="drpList" runat="server" OnSelectedIndexChanged="drpList_SelectedIndexChanged" AutoPostBack="True">
        <br />
        <asp:Label ID="Label1" runat="server"></asp:Label>
This question does not have replies that have been liked.