(.ashx)
<%@ WebHandler Language="C#"Class=“dhtmlxConnector.NET.dhtmlxScheduler.SchedulerConnector” %>
using System;
using System.Web;
using dhtmlxConnectors;
using System.Configuration;
using System.Linq;
using System.Web.Services;
using System.Collections.Generic;
namespace dhtmlxConnector.NET.dhtmlxScheduler
{
///
/// Connector body
///
[WebService(Namespace = “http://tempuri.org/”)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class SchedulerConnector : dhtmlxRequestHandler
{
public override IdhtmlxConnector CreateConnector(HttpContext context)
{
var connector = new dhtmlxSchedulerConnector(
"Events",
"ID",
dhtmlxDatabaseAdapterType.SqlServer2005,
ConfigurationManager.ConnectionStrings["PVIC_DB"].ConnectionString,
"DateStart",
"DateEnd",
"MeetingTitle as text"
);
return connector;
}
}
}
(dataProcessor initialization code)
(Sorry about the messy code. I have to add image button too on that page)
<%@ Page Language=“C#” AutoEventWireup=“true” CodeFile=“Calendar.aspx.cs” Inherits=“Calendar” %>
Booking Calendar
<script src="dhtmlxScheduler/codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<script src="dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="Scripts/connector.js"></script>
<link href="dhtmlxScheduler/codebase/dhtmlxscheduler.css" rel="Stylesheet" type="text/css" charset="utf-8" />
<link href="dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.css" rel="Stylesheet" type="text/css" charset="utf-8" />
<style type="text/css" media="screen">
html, body
{
height:100%;
padding:0px;
margin:0px;
overflow:hidden;
}
.style1
{
height: 21px;
width: 1201px;
}
.style2
{
height: 20px;
width: 141px;
}
.style11
{
width: 38px;
font-size: large;
}
.style14
{
height: 4px;
width: 188px;
text-decoration: none;
}
.style16
{
height: 4px;
width: 190px;
text-align: center;
}
.style35
{
height: 4px;
width: 145px;
text-align: center;
}
.style36
{
width: 141px;
}
.style37
{
width: 141px;
text-align: center;
}
.style39
{
height: 4px;
width: 145px;
}
.style40
{
height: 4px;
width: 141px;
text-align: center;
}
.style41
{
width: 190px;
}
.style47
{
height: 4px;
width: 138px;
}
.style49
{
height: 4px;
width: 296px;
text-align: center;
}
.style50
{
width: 296px;
}
.style51
{
height: 4px;
width: 196px;
}
</style>
<script type="text/javascript" charset="utf-8">
function init() {
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.config.lightbox.sections = [
{ name: "description", height: 130, map_to: "text", type: "textarea", focus: true },
{ name: "location", height: 43, map_to: "details", type: "textarea" },
//{ name: "Tags", height: 30, map_to: "Tags", type: "textarea" },
{ name: "time", height: 72, map_to: "auto", type: "time" }
]
scheduler.locale.labels.section_location = "Meeting Room";
//scheduler.locale.labels.section_Tags = "Tags";
scheduler.locale.labels.section_description = "Meeting Title";
scheduler.config.details_on_create = true;
scheduler.config.details_on_dblclick = true;
scheduler.init('scheduler_here', null, "month");
dp = new dataProcessor("SchedulerConnector.ashx");
scheduler.load("SchedulerConnector.ashx"+"?uid="+ scheduler.uid);
var dp = new dataProcessor("SchedulerConnector.ashx"+"?uid="+scheduler.uid());
dp.init(scheduler);
}
</script>
<table class="style1" align="center">
<tr>
<td class="style49">
<asp:LinkButton ID="HomeLinkButton"
runat="server"
onclick="HomeLinkButton_Click"
CssClass="style14">Home</asp:LinkButton>
</td>
<td class="style37">
<asp:Label ID="DataReviewLabel"
runat="server"
Text="Data Review Room"></asp:Label>
</td>
<td class="style16" style="color: #0099FF">
<strong>
<asp:Label ID="VizLabel"
runat="server"
Text="Viz Room"
CssClass="style11"></asp:Label>
</strong>
</td>
<td class="style40">
<asp:Label ID="RtoLabel"
runat="server"
Text="RTO Room"></asp:Label>
</td>
<td class="style35">
<asp:Label ID="CollaborationLabel"
runat="server"
Text="Collaboration Room"></asp:Label>
</td>
<td class="style51">
</td>
<td class="style47">
<asp:Button ID="LogOutButton" runat="server" onclick="LogOutButton_Click"
style="height: 26px" Text="Log Out" />
</td>
</tr>
<tr>
<td class="style50">
</td>
<td class="style2">
<asp:ImageButton ID="DataReviewImageButton"
runat="server"
Height="100px"
ImageUrl="~/Images/datareview.JPG"
Width="140px"
onclick="DataReviewImageButton_Click"/>
</td>
<td class="style41">
<asp:Image ID="VizImage"
runat="server"
Height="100px"
ImageUrl="~/Images/viz.JPG"
Width="190px" />
</td>
<td class="style36">
<asp:ImageButton ID="RtoImageButton"
runat="server"
Height="100px"
ImageUrl="~/Images/rto.JPG"
Width="140px"
onclick="RtoImageButton_Click" />
</td>
<td class="style39">
<asp:ImageButton ID="CollaborationImageButton"
runat="server"
Height="100px"
ImageUrl="~/Images/collaboration.JPG"
Width="140px"
onclick="CollaborationImageButton_Click"/>
</td>
<td class="style51">
</td>
<td class="style47">
</td>
</tr>
</table>
</div>
</form>
<div id="scheduler_here" class="dhx_cal_container"
style='border: thin dotted #000066; width:80%; height:80%; left: 125px;'>
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_cal_today_button"></div>
<div class="dhx_cal_date"></div>
<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
</div>
<div class="dhx_cal_header">
</div>
<div class="dhx_cal_data">
</div>
</div>