Me.btnAddNewLottedItem.Attributes.Add("onclick", "ShowInsertForm();return false;")
Me.btnAddNewLottedItem.Attributes.Add("onclick", String.Format("ShowInsertForm('{0}');return false;", Session("StockCountID").ToString.Trim))
And here is another example
Me.btnOnJob.OnClientClicking = "StandardConfirm"
JavaScript code:
<script type="text/javascript">
function StandardConfirm(sender, args) {
args.set_cancel(!window.confirm("Are you sure you want to On Job this order?"));
}
</script>