Update event without having to reload page

I have an issue that hopefully is just me missing something simple. ASP.net web application in C#.

My lightbox has a few fields, one of which is the required ‘text’ field added as such

var text = new LightboxText("text", "Short Description"); text.Height = 30; _sched.Lightbox.Add(text);

In week view I click on an area to bring up the lightbox. Make some changes but leave the ‘text’ field alone. In my code-behind, when I save the event to the database I change the text value to some database defined value

changedEvent.text = “Some Other Text”;

Database is updated successfully, the lightbox closes, but when I open the event again the ‘text’ value is still the original placeholder text (‘Short Description’) instead of the value as I set in code and submitted to the database.

When I manually reload the page the value is now correct.

How can i load the changes made in the code-behind without refreshing the page or if needed, how do I reload the page so as not too cause repeated trips to the server?

Scheduler doesn’t read from the database each time an event is loaded; all the data is typically loaded at once and just pulls from a storage object when you open an event. You would have to either:

  • have your codebehind update the javascript event object before the lightbox closes,
  • have your codebehind run javascript to open (but not show) the lightbox, update the event, and close the lightbox,
  • or go into the storage object (scheduler._events if I recall correctly) and edit the event in that array.

Hi,
try using ‘UpdateFieldsAfterSave’ setting. It will allow you to send modified values back to the client-side with AjaxSaveResponse
scheduler-net.com/docs/managing_ … the_server

I am unclear on where to call the UpdateFieldsAfterSave.

Is it part of the configuration settings?

I got it to work
Set the update field flag in my .cs file

_sched.UpdateFieldsAfterSave();

Then in my SchedDataSave.ashx I added the update mapping before I sent response back to screen.

var response = new AjaxSaveResponse(action); response.UpdateField("Location", locationName); context.Response.ContentType = "text/xml"; context.Response.Write(response);

Cheers and thanks for the help!!