The documentation tells you a way how to add a variable..-
In the UpdatePanelAnimation.js you have this lines of code
BorderAnimation = function(color) {
this._color = color;
}
this is then automatically set.
Dim script As String = String.Format( _
CultureInfo.InvariantCulture, _
"Sys.Application.add_load(function(sender, args) {{var {0}_borderAnimation = new BorderAnimation('{1}');var panelElement = document.getElementById('{0}');if (args.get_isPartialLoad()) {{{0}_borderAnimation.animate(panelElement);}}}});", _
updatePanel.ClientID, _
ColorTranslator.ToHtml(BorderColor))
ScriptManager.RegisterStartupScript( _
Me, _
GetType(UpdatePanelAnimationWithClientResource), _
ClientID, _
script, _
True)
So the formatted {1} is replaced with BorderColor that you have on the server side.
You might now want to update the JS constructor like this
BorderAnimation = function(color, otherValue) {
this._color = color;
this._otherValue = otherValue
}
now you do the same with the server side formatting but then you do
...
var {0}_borderAnimation = new BorderAnimation('{1}', '{2}')
...
this is the way how ASP.NET kind of 'connects' Backend with Frontend.
There are some other ways (more elegant) to do that, but thats not the question :)