r p

r p

  • NA
  • 343
  • 0

How to call C# Web Service from .JS file

Oct 23 2013 11:13 AM

I am using a third party tool on my ASP.NET website.
The third party tool opens a pop up box on the screen and collects first name, last name, age etc, and then pass them to the same function which opened the box.
This function is in a .js file. So, I can get first name, last name, age etc in the .JS file of the third party tool.

I want insert those details from the .JS file to SQL database. I hope the best way is to call a Web Service (C#), pass the information to the C# file and it will insert into database. I have to do the same for collecting data from database as well.

When I try to call the WebService from .JS file, I am getting an error - 'MyWebService1' is undefined.

Could you please help me to fix it?

Is there any better approach?
Thanks


Answers (1)