Binding Date vlues to dropdownlist using Specified Range

Posted by Sandhyab under ASP.NET category on | Points: 40 | Views : 1239
 <asp:DropDownList ID="dropDate" runat="server">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
dropDate.DataSource = BindDateDropDown();
dropDate.Items.Insert(0, new ListItem("--Select--", ""));


private object BindDateDropDown()
return Enumerable.Range(1, 31);


Comments or Responses

Login to post response