views:

48

answers:

2

Hi,

I need to call a .cs method from JavaScript function; how can I do that?

Thanks

A: 

You need to postback to the server by either submitting an HTML form or using JavaScript. If you're not in a browser, it might be more of a challenge because I don't think the Windows Scripting Host includes anything that can call the web by default. In which case you could use something like cURL instead.

Neil Barnwell
+1  A: 

You need to do post back to the server then catch this post back on Pageload event then execute the cs function.

check the following article: Understanding the JavaScript __doPostBack Function

Wael Dalloul