Click here to Skip to main content
15,885,278 members
Articles / Web Development / HTML

Using DayPilot (Outlook-Like Calendar/Scheduling Control for ASP.NET)

Rate me:
Please Sign up or sign in to vote.
4.83/5 (64 votes)
30 Mar 2015Apache7 min read 367.1K   4.2K   286  
Showing the features of a flexible ASP.NET event calendar/scheduling control.
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="BindingArrayList.aspx.cs" 
Inherits="BindingArrayList" Title="Binding Calendar to ArrayList | DayPilot Lite for ASP.NET WebForms Demo" Culture="en-US" %>

<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <daypilot:daypilotcalendar id="DayPilotCalendar1" runat="server" DataStartField="Start"
            dataendfield="End" datatextfield="Name" datavaluefield="Id"
            
            ></daypilot:daypilotcalendar>
    <br />
    <h2>
        ArrayListBinding.aspx</h2>
    <pre>
    &lt;daypilot:daypilotcalendar 
        &nbsp; id="DayPilotCalendar1"
        &nbsp; runat="server"
        &nbsp; DataStartField="Start"
        &nbsp; dataendfield="End"
        &nbsp; datatextfield="Name"
        &nbsp; datavaluefield="Id"&gt;
        &lt;/daypilot:daypilotcalendar&gt;</pre>
    <h2>
        ArrayListBindix.aspx.cs</h2>
    <pre>    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DayPilotCalendar1.DataSource = getData();
            DataBind();
        }
    }

    ArrayList getData()
    {
        ArrayList al = new ArrayList();

        CustomEvent ce = new CustomEvent();
        ce.Start = Convert.ToDateTime("15:30");
        ce.End = Convert.ToDateTime("16:30");
        ce.Name = "My event";
        ce.Id = "1";

        al.Add(ce);

        return al;

    }

    public class CustomEvent
    {
        private string name;
        private DateTime start;
        private DateTime end;
        private string id;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public DateTime Start
        {
            get { return start; }
            set { start = value; }
        }

        public DateTime End
        {
            get { return end; }
            set { end = value; }
        }

        public string Id
        {
            get { return id; }
            set { id = value; }
        }
    }</pre>
    <p>
        &nbsp;</p>
</asp:Content>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Czech Republic Czech Republic
My open-source event calendar/scheduling web UI components:

DayPilot for JavaScript, Angular, React and Vue

Comments and Discussions