How to set custom lightbox

Hi everyone !

I am using the ASP .NET version of the sheduler and I need help to set custom lightbox fields.

I have a form.ascx file like this :

[code]<%@ Control Language=“C#” AutoEventWireup=“true” CodeBehind=“form.ascx.cs” Inherits=“test.form” %>

  <span class="label">From</span><input id="Text2" name="start_date"  type="text"/>
  <span class="label">to</span><input id="Text3" name="end_date" type="text"/>

  <span class="label">Room_id</span><input id="Text4" name="room_id" type="text"/>
  <span class="label">User Id</span><input id="Text5" name="user_id" type="text"/>
  <input id="Hidden1" name="id" type="hidden"/>

and I use it like :

            var form = Scheduler.Lightbox.SetExternalLightboxForm("~/form", 640, 180);

into Default.aspx.cs

I get an error message when I try to add an event to the calendar. File couldn’t be find error 404.

try resolving the url before passing it to the method:

var form = Scheduler.Lightbox.SetExternalLightboxForm(System.Web.VirtualPathUtility.ToAbsolute("~/form"), 640, 180);

Thanks a lot to be so active on this forum. You helped me a lot, so both of custom lightbox and event color problems are resolved.

Now, my problem occurs when I try to save data and get it back from database.

I will show source code first and explain the problem after :

First I add some filed in the lightbox this way :


[code] var select1 = new LightboxSelect(“textColor”, “Couleur (texte)”);
var items1 = new List(){
new { key = “white”, label = “Blanc” },
new { key = “red”, label = “Rouge” },
new { key = “yellow”, label = “Jaune” },
new { key = “blue”, label = “Bleu” }

        var select2 = new LightboxSelect("color", "Couleur (événement)");
        var items2 = new List<object>(){
            new { key = "white", label = "Blanc" },
            new { key = "red", label = "Rouge" },
            new { key = "yellow", label = "Jaune" },
            new { key = "blue", label = "Bleu" }


[code]using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DHTMLX.Common;
using DHTMLX.Helpers;
using System.Globalization;

namespace SchedulerNetAsp


public class Save : IHttpHandler

    public void ProcessRequest(HttpContext context)

        var action = new DataAction(context.Request.Form);
        var data = new SchedulerDataContext();


            var changedEvent = (Event)DHXEventsHelper.Bind(typeof(Event), context.Request.Form);//create event object from request

            switch (action.Type)
                case DataActionTypes.Insert: // define here your Insert logic
                case DataActionTypes.Delete: // define here your Delete logic
                    changedEvent = data.Events.SingleOrDefault(ev => == action.SourceId);
                default:// "update" // define here your Update logic
                    var updated = data.Events.SingleOrDefault(ev => == action.SourceId);
                    //update "updated" object by changedEvent's values, 'id' should remain unchanged
                    DHXEventsHelper.Update(updated, changedEvent, new List<string>() { "id" });
            action.TargetId =;
            action.Type = DataActionTypes.Error;

        context.Response.ContentType = "text/xml";
        context.Response.Write(new AjaxSaveResponse(action).ToString());

    public bool IsReusable
            return false;


Now the problem is that custom fields values are not saved in the database even if columns like color and textColor are created in the Events table…

How can I insert and get those values ?

Thanks !

I add a file to show my actual Event table. color and textColor fields always worth NULL :frowning:

As seen on the picture, I am able to change colors values, but they aren’t saved in the database…

maybe you’ve added additional columns without updating a model class (Event), so the model is not aware of these values.
If you use LinqToSql, the simplest way to check is to open a model designer (double click on dbml file), delete an Event model, create it again from the Events table and rebuild the project

This is what my DBML file actually look like.

About custom properties, I understand I have to modifie the Event object to make some client-side operations.

But I thought color and textColor properties was done…

Still not saving in the database :S

Thanks !

And where is the Event class ?

I work with the ASP .NET sample, so I do not have Models, Views and Controllers…


in that example classes are created using a Linq To Sql visual designer … -dbml-file

Make sure the properties of model class are mapped to the database table.

Please see the working example …