You must Sign In to post a response.
  • Category: ASP.Net MVC

    How To Display All Day of Month as Column in asp.net MVC Dynamically ?

    Hi Friends Need Help,
    How To Display All Day of Month as Column in asp.net MVC Dynamically ?
  • #768901
    See Image

    Delete Attachment

  • #768938
    You can use given code to create your own Day, Month and Year Date Selector using three DropDownList in C#
     private int Day
    {
    get
    {
    if (Request.Form[ddlDay.UniqueID] != null)
    {
    return int.Parse(Request.Form[ddlDay.UniqueID]);
    }
    else
    {
    return int.Parse(ddlDay.SelectedItem.Value);
    }
    }
    set
    {
    this.PopulateDay();
    ddlDay.ClearSelection();
    ddlDay.Items.FindByValue(value.ToString()).Selected = true;
    }
    }
    private int Month
    {
    get
    {
    return int.Parse(ddlMonth.SelectedItem.Value);
    }
    set
    {
    this.PopulateMonth();
    ddlMonth.ClearSelection();
    ddlMonth.Items.FindByValue(value.ToString()).Selected = true;
    }
    }
    private int Year
    {
    get
    {
    return int.Parse(ddlYear.SelectedItem.Value);
    }
    set
    {
    this.PopulateYear();
    ddlYear.ClearSelection();
    ddlYear.Items.FindByValue(value.ToString()).Selected = true;
    }
    }

    public DateTime SelectedDate
    {
    get
    {
    try
    {
    return DateTime.Parse(this.Month + "/" + this.Day + "/" + this.Year);
    }
    catch
    {
    return DateTime.MinValue;
    }
    }
    set
    {
    if (!value.Equals(DateTime.MinValue))
    {
    this.Year = value.Year;
    this.Month = value.Month;
    this.Day = value.Day;
    }
    }
    }


  • Sign In to post your comments