TelerikDeveloper.com

TelerikDeveloper.com

sgray128 7/21/2016 1:06:38 PM

Add an event handler in code for a RadButton

Here are a couple of quick examples for adding an event handler in code for a RadButton


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>