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>

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences