I was trying to use GET and ran into trouble. Now I am trying to switch to POST to try it out. I switched my jquery statements from
Type: GET,
to
Type: POST,
I switched my .asmx code behind to
[WebMethod(EnableSession = true)]
[ScriptMethod]
public string testGetParametersDynamic(string firstName, string lastName)
{
string fullName = firstName + lastName;
return fullName;
}
from
[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = true)]
public string testGetParametersDynamic(string firstName, string lastName)
{
string fullName = firstName + lastName;
return fullName;
}
I am now getting this error:
An attempt was made to call the method \testGetParametersDynamic\u0027 using a GET request
what am I missing?
Add following attribute to service
EDIT
Check out the following code.It’s working fine
WebService.asmx