I’m not able to update existing event after i navigated to another page but it’s working fine if i don’t. It happened during the debugging mode as well. I’m not able to update existing event created in previous debug session.
[code]Scheduler = New DHXScheduler()
Scheduler.Extensions.Add(SchedulerExtensions.Extension.Recurring)
Scheduler.Config.first_hour = 8
Scheduler.Config.last_hour = 19
Scheduler.Config.time_step = 30
Scheduler.Config.limit_time_select = True
Scheduler.Skin = DHXScheduler.Skins.Flat
Scheduler.DataAction = Me.ResolveUrl("~/Connector.ashx")
Scheduler.SaveAction = Me.ResolveUrl("~/Save.ashx")
Scheduler.LoadData = True
Scheduler.EnableDataprocessor = True
‘Title’
Dim titl = New LightboxText(“text”, “Title”)
titl.Height = 30
Scheduler.Lightbox.Add(titl)
‘Description’
Dim descr = New LightboxText(“event_details”, “Description”)
descr.Height = 60
Scheduler.Lightbox.Add(descr)
‘Venue’
Dim venue = New LightboxText(“event_venue”, “Venue”)
venue.Height = 30
Scheduler.Lightbox.Add(venue)
'Recurring options
Scheduler.Lightbox.Add(New LightboxRecurringBlock(“rec_type”, “Recurring”))
‘Time’
Scheduler.Lightbox.Add(New LightboxTime(“time”))[/code]
// Save.ashx
[code]Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = “text/xml”
Dim action = New DataAction(context.Request.Form)
Dim data = New SchedulerDataContext()
Try
Dim changedEvent = DirectCast(DHXEventsHelper.Bind(GetType(Events_Tran), context.Request.Form), Events_Tran)
Dim isFinished As Boolean = deleteRelated(action, changedEvent, data)
If Not isFinished Then
Select Case action.Type
Case DataActionTypes.Insert
' define here your Insert logic
data.Events_Trans.InsertOnSubmit(changedEvent)
Exit Select
Case DataActionTypes.Delete
' define here your Delete logic
changedEvent = data.Events_Trans.SingleOrDefault(Function(ev) ev.id = action.SourceId)
data.Events_Trans.DeleteOnSubmit(changedEvent)
Exit Select
Case Else
' "update" // define here your Update logic
Dim updated = data.Events_Trans.SingleOrDefault(Function(ev) ev.id = action.SourceId)
DHXEventsHelper.Update(updated, changedEvent, New List(Of String)() From {"id"})
Exit Select
End Select
End If
data.SubmitChanges()
action.TargetId = changedEvent.id
action = insertRelated(action, changedEvent, data)
Catch a As Exception
action.Type = DataActionTypes.[Error]
End Try
context.Response.Write(New AjaxSaveResponse(action).ToString())
End Sub[/code]
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim dataResult As SchedulerAjaxData
dataResult = New SchedulerAjaxData((New SchedulerDataContext()).Events_Trans)
context.Response.ContentType = "application/json"
context.Response.Write(dataResult.ToString())
End Sub