How to pass data from User Page to the ashx page

Hi,

I’m usin DMTHLX scheduler with net connector:

[code]Public Overrides Function CreateConnector(ByVal context As HttpContext) As IdhtmlxConnector

    Dim connector As dhtmlxSchedulerConnector

    connector = New dhtmlxSchedulerConnector("Events", _
                                        "EventID", _
                                        dhtmlxDatabaseAdapterType.SqlServer2005, _
                                        ConfigurationManager.ConnectionStrings("SamplesDatabase").ConnectionString, _
                                        "FromDate", "ToDate", _
                                        "Subject AS Text, section_id AS Tags")


    Return connector


End Function[/code]

I need to save into DB the name and date of the user who has inserted/modified an event.

Is it possible? How can I pass the username value to the connector?

Hi,
I’ve tried with AddHandler connector.BeforeUpdate: it doesn’t give errors but it doesn’t do the custom update:

    Public Overrides Function CreateConnector(ByVal context As HttpContext) As IdhtmlxConnector

        Dim connector As dhtmlxSchedulerConnector

        connector = New dhtmlxSchedulerConnector("Events", _
                                            "EventID", _
                                            dhtmlxDatabaseAdapterType.SqlServer2005, _
                                            ConfigurationManager.ConnectionStrings("SamplesDatabase").ConnectionString, _
                                            "FromDate", "ToDate", _
                                            "Subject AS Text, section_id AS Tags, status")


        AddHandler connector.BeforeUpdate, AddressOf connector_BeforeUpdate


        Return connector


    End Function



    Private Sub connector_BeforeUpdate(ByVal sender As Object, ByVal e As DataActionProcessingEventArgs)
        e.DataAction.Data.Add("last_update", Tools.ConvertToString(DateTime.Now))
    End Sub

Check 3rd code snippet at
docs.dhtmlx.com/doku.php?id=dhtm … ex_updates

I’ve already tried it (transalted in vb .net):

[code] Public Overrides Function CreateConnector(ByVal context As HttpContext) As IdhtmlxConnector

    Dim connector As dhtmlxSchedulerConnector

    connector = New dhtmlxSchedulerConnector("Events", _
                                        "EventID", _
                                        dhtmlxDatabaseAdapterType.SqlServer2005, _
                                        ConfigurationManager.ConnectionStrings("SamplesDatabase").ConnectionString, _
                                        "FromDate", "ToDate", _
                                        "Subject AS Text, section_id AS Tags, last_update")


    AddHandler connector.BeforeUpdate, AddressOf connector_BeforeUpdate


    Return connector


End Function



Private Sub connector_BeforeUpdate(ByVal sender As Object, ByVal e As DataActionProcessingEventArgs)

    Dim id As Integer = e.DataAction.PrimaryKeyValue
    Me.Connector.Request.Adapter.ExecuteNonQuery("UPDATE Events SET last_update = " & Now & " WHERE EventID = " & id & " ")
    e.DataAction.SetCompleted()

End Sub[/code]

but it doesn’t do the update.

Is it correct to attach the event handler inside .ashx page?
Or have I to attach it from the aspx page?!

Most probably you need to change code as

//last_update was removed connector = New dhtmlxSchedulerConnector("Events", _ "EventID", _ dhtmlxDatabaseAdapterType.SqlServer2005, _ ConfigurationManager.ConnectionStrings("SamplesDatabase").ConnectionString, _ "FromDate", "ToDate", _ "Subject AS Text, section_id AS Tags")

Because currently you are have last_update in two places - initial config and Add command.