I have never done this, so I really don't know the deatils on it, but you can use XML for interopratability between java and C#. I Don't know how well this will work in javascript.
http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns2/
If the javascript is running on the ASP page in question you could just use constants (as in javascript constants) that the ASP will change when the page is rendered.
So the ASP kinda programmes the javascript for you.