You could concatenate things directly like this...
this.cmdNext.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "dnn.dom.getById('" + this.NSNext.ClientID + "').value + '~' + dnn.dom.getById('" + this.NSPage.ClientID + "').value", "nsNextSuccessFunc", "this", "nsNextErrorFunc"));
But I would probably code it like this...
this.cmdNext.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "mynicefunctionnamehere()", "nsNextSuccessFunc", "this", "nsNextErrorFunc"));
and somewhere in the page (or separate js file) define
function mynicefunctionnamehere()
{
return dnn.dom.getById('" + this.NSNext.ClientID + "').value + '~' + dnn.dom.getById('" + this.NSPage.ClientID + "').value;",
}
On the serverside you would parse the argument (i.e. arg.split("~"))
Note: If you are unsure that the tilda (~) is a safe character you can use my predefined character for delimiting the string...
function mynicefunctionnamehere()
{
return dnn.dom.getById('" + this.NSNext.ClientID + "').value + COL_DELIMITER + dnn.dom.getById('" + this.NSPage.ClientID + "').value;",
}
on the serverside the delimiter is found in the clientapi namespace.
arg.split(ClientAPI.COLUMN_DELIMITER)