2: function onAppLoad()
4: var vSampleProp = '<%=MySampleProperty%>';
Realize, that I am saying “access” and not call. Because, what happens here is while the ASP.Net is building the web-page to send down to the browser, it sees the code inside <%…%>, calls the property, fills in the value and then sends it down to the browser.
If you need to “call” a method on the server then you need to look at web-services. (Basically you will need to use AJAX, to get the server to send your data asynchronously).