Live Chat Icon For mobile
Live Chat Icon

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 + '\');' ;

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.