I have C# code in which I have embedded javascript code. The CalculateSalary() method is defined in the C# code. But when I try to call it from the javascript code, an error is returned.
I have C# code in which I have embedded javascript code. The CalculateSalary() method
Share
Wow man, this is so wrong.
Your c# code will run in another context (server, service, etc..) and javascript will run on browser context. You cannot call a method written in your server directly from javascript. You need a comunication layer like ajax or write your CalculateSalary in javascript so it can run on client machine (browser).