I developed a custom control that utilizing client side functionality also. What I needed is calling client side function on clicking button.
to accomplish this we need to find the clientside object for that we use $find passing clientId of the custom web control as mentioned below.
btn.OnClientClick = string.Format("$find('{0}').add({1});", this.ClientID, ‘add’);