I am trying a simple ClientAPI callback app, but have come unstuck with sharing a variable between Clientside and serverside.
I am trying to pass a string variable from the onclick method of a button to the server RaiseClientAPICallBackEvent. I code
dim szPrev as string
dim startdate as datetime
then in the Page Load I say
ClientAPI.RegisterClientVariable( Page, szPrev, startdate.AddMonths(-1).ToString(), True )
but I find this has NOT set the value of szPrev as I expected, so I add
szPrev = startdate.AddMonths(-1).ToString()
Still in the Page_Load I add
Me.btPrev.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, _
"dnn.getVar('szPrev')", "successFunc", "'" & Me.ClientID & "'", "errorFunc"))
but on the serverside event, I find that eventArgument is undefined.
Am I missing something simple? TIA!