How to create dynamic javascripts in server side code based on server side variables?

Platform: ASP.NET|Category: Client Side Scripting

Here’s and example:

VB.NET

Dim value As String = 'pic1.jpg'
Button1.Attributes('onMouseOver') = 'alert( ’' + value + '’);'

C#

string value = 'pic1.jpg'; 
Button1.Attributes['onMouseOver'] = 'alert( \'' + value + '\');' ;