2

usually when I programming a web application with java I use DWR library to enables Java on the server and JavaScript in a browser to interact and call each other.

for example, I can call a java routine to access the DB directly from a javascript code, and this is really useful.

Now I'm trying to create a web application with visual studio 2012 and I don't know if I can do the same thing with asp.net.

I've tried some "googling" but i don't had success. Someone can help me?

Thanks and sorry for my bad english >.<

onof
  • 17,167
  • 7
  • 49
  • 85
Alist3r
  • 556
  • 3
  • 11
  • 27

1 Answers1

1

You can access the server side code by using javaScript.
There are some good links on this site.

Based on my experience, i found this web service to be a very useful tool.

1. You must have a web service or asmx. (check how to create here).
2. Use jQuery or other method of Ajax POST to communicate with the web service.

$.ajax({
    url: "/location_of_your_webservice/ASMX_FILE.asmx/backend_method_or_function",
    ...


Or if you just have to fire a button click that triggers the backend event then you might want to check this.

Community
  • 1
  • 1
evilom
  • 573
  • 6
  • 19