Data loader's Url


In my projet built in ASP.NET MVC, I’ve several areas. I would like use DHTMLx scheduler for MVC. But when I want load data from action, this component doesn’t use area (ASP.NET MVC).

Url expected : hostname/area.aspx/Client/Data?timeshift=-120
Url actual : hostname/Client/Data?timeshift=-120

However I have add well url like :

var scheduler = new DHXScheduler(this); scheduler.Data.Loader.AddPath(context.RouteUrl(ETEN.AreaName, new { action = "Data", controller = "Client" }));

The DHTMLx scheduler use two url to find data (mine and their)
Did you know a solution to use area? Or an other solution to disable default url?



try to initialize scheduler using default constructor, and set url using DataAction property

var scheduler = new DHXScheduler(); scheduler.DataAction = context.RouteUrl(ETEN.AreaName, new { action = "Data", controller = "Client" });

Thanks Aliaksandr,

Your response worked. I take your experience for a second question.
Do you have an example to implement the data loading with JSON?

all the samples loads data from json, the default data renderer supports only this format.
If you want to implement custom data renderer, format is pretty simple

[ { start_date:"2009-07-01 6:00", end_date:"2009-07-01 8:00", text:"Some text"}, .... ]
after scheduler parse it, it will create events, which will contain the same set of the properties as the recieved objects
start_date and end_date should be sent in format, defined in DHXScheduler.Config.xml_date

the ‘start_date’, ‘end_date’ and ‘text’ properties are mandatory

Ok thanks :smiley: .

I’ve another question. I 'would like use “SetExternalLightBox” method.

My code :


When, I run my sample, Url’s request is : host%28SQL%29.aspx/Client/LightboxControl?id=1

It’is encoded, parentheses are converted. Do you have a solution?


Hello Geoffrey,
this code scheduler.Lightbox.SetExternalLightbox("/host(SQL).aspx/Client/LightboxControl"); works for me.
But if you creating url using some helper classes, e.g.

new Uri("/host(SQL).aspx/Client/LightboxControl") it will escape brackets and some other characters
you may try this overload

new Uri("/host(SQL).aspx/Client/LightboxControl", true) , however its deprecated, or just pass url as a string


Thanks for your response.
It’s work for me too. :slight_smile: