Not sure if this works in your situation, but I think it would be best to attach javascript to the event dynamically in your code behind the page load and just set the parameter value at that point.
For instance:
btnSubmit.Attributes.Add("onclick","alert(" + someProperty + ");");
source share