I have the following WebMethod in my fileName.asmx.cs file.
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetData(string value)
{
//-----
//Respective code querying the database
//-----
}
Here is the respective ajax call using jQuery
getData: function (type) {
var response = "";
$.ajax({
type: "POST",
dataType: 'json',
url: "../GetData",
data: '{value:' + type.toString() + '}',
async: false,
contentType: "application/json; charset=utf-8",
success: function (msg) {
console.log('succes', msg)
response = msg;
}
});
return response.d;
}
I add breakpoints in my WebMethod for debugging, however it is not stepping into it.
I'm trying to do this my localhost:2133, With reference some SO Answers I also tried attaching the following process but no success.

Without debugging I'm not able to solve errors, Since I already wasted a couple of hours I posted here.
Can someone guide me(couple of screenshots will be more helpful) how to debug a WebMethod in ASP.NET?
Updates 1: I also tried putting Console.WriteLine() in the WebMethod. But nothing shown in the output screen of VS2012.
Updates 2: I'm getting error will building the file, but the site is up in my localhost. Is this error is causing me trouble to debug the WebMethod? or to be clear
Only clean code (without error) can only be debugged?
WebMethod. I'm getting the error response from server (ie, my localhost). I also tried the same for a successfulWebMethod, but no success :(try..return successJson..catch.."\error\") This is also not working for a successful calls.WebMethod. Anyway thanks for pointing it