In my current project, I have a webservice file called MyServices.asmx. This webservice I want to reference in my Default.aspx.cs file.
My Code:
MyServices newService = new MyServices();
newService.addUser(txFirstName.Text, txLastName.Text, txtEmail.Text,
txtUserName.Text, txtPassword.Text, txtBalance.Text);
But when I refer to that webservice (as shown below), I get error saying:
“The type or namespace name ‘MyServices’ could not be found (are you missing a using directive or an assembly reference?)“
What should I do to correct this error?
Current Solution of Adding Service Reference still gives me that error. Can you please suggest what could be wrong?
I was able to resolve my problem by creating another webservice file.
Instead of MyService.asmx, I created a new one called MyServ.asmx and copied the code from MyService.asmx
By doing that, I was able to get the webservice reference in my code.