1
Reply

How to dynamically register and invoke javascript from C#?

Vithal Wadje

Vithal Wadje

11y
1.5k
0
Reply

    . Use the method ClientScript.RegisterClientScriptBlock. Note that there was an older method too called as
    Page.RegisterClientScriptBlock, but now this is deprecated.
    Example (C#):
    ClientScript.RegisterClientScriptBlock(typeof(Page), "theScript", "alert('Cracking interviews is now a cakewalk')", true);