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

DayPilot - Building an Outlook-Like Calendar Component for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.86/5 (120 votes)
8 May 2016Apache5 min read 474.7K   9K   391  
A good-looking ASP.NET control that shows events visually arranged in a day calendar. Includes design-time support and data binding.
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="UpdatePanel.aspx.cs"
    Inherits="UpdatePanel" Title="DayPilot Lite Demo | ASP.NET AJAX (UpdatePanel)" %>

<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<div style="color:red; font-weight: bold;">UpdatePanel1:</div>
    <div style="border:1px solid red; padding: 10px;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Calendar ID="Calendar1" runat="server" CssClass="calendar" OnSelectionChanged="Calendar1_SelectionChanged" DayNameFormat="FirstTwoLetters">
                <TodayDayStyle BorderColor="Red" BorderStyle="Solid" BorderWidth="1px"></TodayDayStyle>
                <SelectedDayStyle BackColor="#FBE694" ForeColor="Black" CssClass="selected"></SelectedDayStyle>
                <TitleStyle BackColor="White"></TitleStyle>
                <OtherMonthDayStyle ForeColor="#ACA899"></OtherMonthDayStyle>
            </asp:Calendar>
            <br />
            <DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" DataEndField="end"
                DataStartField="start" DataTextField="name" DataValueField="id" Days="7" NonBusinessHours="Hide" OnEventClick="DayPilotCalendar1_EventClick"
                OnTimeRangeSelected="DayPilotCalendar1_TimeRangeSelected" EventClickJavaScript="alert('Event with ID {0} clicked.');" TimeRangeSelectedJavaScript="alert('Time slot starting at {0} clicked.');"></DayPilot:DayPilotCalendar>
        </ContentTemplate>
    </asp:UpdatePanel>
        </div>    
</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