Is it possible to execute a Javascript from server side? Seems foolish, I know one is client side and other is server side. Still I have a requirement to invoke a JavaScript based on some condition on a radbutton click?
It is possible to execute a JavaScript from server-side code. In order to do this, make sure that the code is actually inserted on the page – the easiest way is to put a simple alert() and check if it is fired. Also the controls are rendered on the page before referencing them in your JavaScript function. Please have a look at the following sample code.
Please have a look at the following code I tried which works fine at my end. For the JavaScript to work properly, it should be placed inside the html body as follows.