Click here to Skip to main content
15,896,290 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created the service class as follows

C#
public class Service : System.Web.Services.WebService
{
public void samplemeth()
{
...........
...........
}
}

public enum result{ 0, 1 }

public class Sample
{
............
............
}


i added the reference to the service but my problem is i am able to access the Service class and result enum but i am unable to access the Sample class.

Please give me a solution how can i access the class inside this service
Posted

1 solution

C#
[WebMethod(Description = "This is my Sample class")]
 public class Sample
{
............
............
}

Pretty certain you need to add the webmethod declarations.
C#
//to return json for jquery etc.
 [WebMethod(Description = "This is my Sample class")]
 [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public class Sample
{
............
............
}
 
Share this answer
 
v2

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