Pages

Wednesday, March 10, 2010

Call Javascript from ASP.Net code behind

This is a very simple code on ASP.Net code behind to call a pre-defined Javascript function on client side or in-line Javascript.
Dim script As String = "[Javascript function or in-line code goes here]"
Page.RegisterClientScriptBlock("[Any name]", script)