Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,

I have two projects in my solution : Presentation and CommonControls.

I need to call a function defined in a class inside CommonControls. But this call has to be from the javascript function defined in Presentation which is a common js file for Presentation project.

How do I achieve this?

Thanks in advance.
Posted
Updated 20-Jun-13 9:29am
v2

1 solution

You never ever call a code-behind function from JavaScript. "Code behind" is something executed by the HTTP server, on server side, and JavaScript is called by the browser, on the client side. You can trigger some code-behind code and get some response only using Ajax. Please start here:
http://en.wikipedia.org/wiki/Ajax_%28programming%29[^],
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/[^],
http://ajaxcontroltoolkit.codeplex.com/[^],
http://www.ajaxtoolkit.net/[^],
http://api.jquery.com/jQuery.ajax/[^].

Good luck,
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900